Skip to content

Commit

Permalink
fix(code-editor): allow creating hooks with hook type as name (#11698)
Browse files Browse the repository at this point in the history
* fix(code-editor): allow creating hooks with hook type as name

* pr comment

* even better
  • Loading branch information
laurentlp committed Apr 6, 2022
1 parent 162817b commit fd96a81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/code-editor/src/backend/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const FileTypes: { [type: string]: FileDefinition } = {
baseDir: '/hooks',
dirListingAddFields: (filepath: string) => ({ hookType: filepath.substr(0, filepath.indexOf('/')) }),
upsertLocation: (file: EditableFile) => `/hooks/${file.hookType}`,
upsertFilename: (file: EditableFile) => file.location.replace(file.hookType, ''),
upsertFilename: (file: EditableFile) => file.location.replace(`${file.hookType}/`, ''),
shouldSyncToDisk: true
},
validate: async (file: EditableFile, isWriting?: boolean) => {
Expand Down

0 comments on commit fd96a81

Please sign in to comment.