From d574e438123485a96295167b240beba23ae4afec Mon Sep 17 00:00:00 2001 From: yassinedorbozgithub Date: Sun, 13 Oct 2024 08:27:28 +0100 Subject: [PATCH] fix: attachment spelling issue --- api/migrations/models/index.ts | 4 ++-- api/src/attachment/controllers/attachment.controller.ts | 4 ++-- frontend/src/components/contents/ContentImportDialog.tsx | 6 +++--- frontend/src/components/nlp/NlpImportDialog.tsx | 6 +++--- .../src/components/visual-editor/form/MessageForm.tsx | 2 +- frontend/src/services/api.class.ts | 8 ++++---- frontend/src/types/message.types.ts | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/api/migrations/models/index.ts b/api/migrations/models/index.ts index aa45307..02622a8 100644 --- a/api/migrations/models/index.ts +++ b/api/migrations/models/index.ts @@ -63,7 +63,7 @@ async function mongoMigrationConnection() { async function getModels() { await mongoMigrationConnection(); - const AttachementModel = mongoose.model( + const AttachmentModel = mongoose.model( Attachment.name, attachmentSchema, ); @@ -117,7 +117,7 @@ async function getModels() { const UserModel = mongoose.model(User.name, userSchema); return { - AttachementModel, + AttachmentModel, BlockModel, BotstatsModel, ContentModel, diff --git a/api/src/attachment/controllers/attachment.controller.ts b/api/src/attachment/controllers/attachment.controller.ts index e9e8a4b..9cc8a05 100644 --- a/api/src/attachment/controllers/attachment.controller.ts +++ b/api/src/attachment/controllers/attachment.controller.ts @@ -73,8 +73,8 @@ export class AttachmentController extends BaseController { async findOne(@Param('id') id: string): Promise { const doc = await this.attachmentService.findOne(id); if (!doc) { - this.logger.warn(`Unable to find Attachement by id ${id}`); - throw new NotFoundException(`Attachement with ID ${id} not found`); + this.logger.warn(`Unable to find Attachment by id ${id}`); + throw new NotFoundException(`Attachment with ID ${id} not found`); } return doc; } diff --git a/frontend/src/components/contents/ContentImportDialog.tsx b/frontend/src/components/contents/ContentImportDialog.tsx index 41954ec..4ed2a4f 100644 --- a/frontend/src/components/contents/ContentImportDialog.tsx +++ b/frontend/src/components/contents/ContentImportDialog.tsx @@ -31,7 +31,7 @@ export const ContentImportDialog: FC = ({ closeDialog, ...rest }) => { - const [attachmentId, setAttachementId] = useState(null); + const [attachmentId, setAttachmentId] = useState(null); const { t } = useTranslate(); const { toast } = useToast(); const { apiClient } = useApiClient(); @@ -58,7 +58,7 @@ export const ContentImportDialog: FC = ({ ); const handleCloseDialog = () => { closeDialog(); - setAttachementId(null); + setAttachmentId(null); }; const handleImportClick = () => { if (attachmentId && data?.contentType?.id) { @@ -76,7 +76,7 @@ export const ContentImportDialog: FC = ({ format="basic" accept="text/csv" onChange={(id, _) => { - setAttachementId(id); + setAttachmentId(id); }} label="" value={attachmentId} diff --git a/frontend/src/components/nlp/NlpImportDialog.tsx b/frontend/src/components/nlp/NlpImportDialog.tsx index d62e0bd..c539c58 100644 --- a/frontend/src/components/nlp/NlpImportDialog.tsx +++ b/frontend/src/components/nlp/NlpImportDialog.tsx @@ -29,7 +29,7 @@ export const NlpImportDialog: FC = ({ closeDialog, ...rest }) => { - const [attachmentId, setAttachementId] = useState(null); + const [attachmentId, setAttachmentId] = useState(null); const { t } = useTranslate(); const queryClient = useQueryClient(); const { toast } = useToast(); @@ -63,7 +63,7 @@ export const NlpImportDialog: FC = ({ ); const handleCloseDialog = () => { closeDialog(); - setAttachementId(null); + setAttachmentId(null); }; return ( @@ -76,7 +76,7 @@ export const NlpImportDialog: FC = ({ format="basic" accept="text/csv" onChange={(id, _) => { - setAttachementId(id); + setAttachmentId(id); }} label="" value={attachmentId} diff --git a/frontend/src/components/visual-editor/form/MessageForm.tsx b/frontend/src/components/visual-editor/form/MessageForm.tsx index eefff20..e8a4e9d 100644 --- a/frontend/src/components/visual-editor/form/MessageForm.tsx +++ b/frontend/src/components/visual-editor/form/MessageForm.tsx @@ -24,7 +24,7 @@ export const MessageForm = () => { {/* TEXT BLOCK */} {Array.isArray(block?.message) ? : null} - {/* ATTACHEMENT BLOCK */} + {/* ATTACHMENT BLOCK */} {block?.message && "attachment" in block?.message ? ( ) : null} diff --git a/frontend/src/services/api.class.ts b/frontend/src/services/api.class.ts index fe466e5..f1f6d99 100644 --- a/frontend/src/services/api.class.ts +++ b/frontend/src/services/api.class.ts @@ -200,19 +200,19 @@ export class ApiClient { return data; } - async importNlpSamples(attachementId: string) { + async importNlpSamples(attachmentId: string) { const { _csrf } = await this.getCsrf(); const { data } = await this.request.post( - `${ROUTES.NLP_SAMPLE_IMPORT}/${attachementId}`, + `${ROUTES.NLP_SAMPLE_IMPORT}/${attachmentId}`, { _csrf }, ); return data; } - async importContent(contentTypeId: string, attachementId: string) { + async importContent(contentTypeId: string, attachmentId: string) { const { data } = await this.request.get( - `${ROUTES.CONTENT_IMPORT}/${contentTypeId}/${attachementId}`, + `${ROUTES.CONTENT_IMPORT}/${contentTypeId}/${attachmentId}`, ); return data; diff --git a/frontend/src/types/message.types.ts b/frontend/src/types/message.types.ts index 818151e..a1b9dea 100644 --- a/frontend/src/types/message.types.ts +++ b/frontend/src/types/message.types.ts @@ -38,7 +38,7 @@ export enum FileType { unknown = "unknown", } -// Attachements +// Attachments export interface AttachmentAttrs { name: string; type: string;