Skip to content

Commit

Permalink
Merge pull request #210 from Hexastack/209-issue-attachment-spelling-…
Browse files Browse the repository at this point in the history
…issue

fix: attachment spelling issue
  • Loading branch information
marrouchi authored Oct 15, 2024
2 parents e18cf92 + d574e43 commit 15eee17
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions api/migrations/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async function mongoMigrationConnection() {

async function getModels() {
await mongoMigrationConnection();
const AttachementModel = mongoose.model<Attachment>(
const AttachmentModel = mongoose.model<Attachment>(
Attachment.name,
attachmentSchema,
);
Expand Down Expand Up @@ -117,7 +117,7 @@ async function getModels() {
const UserModel = mongoose.model<User>(User.name, userSchema);

return {
AttachementModel,
AttachmentModel,
BlockModel,
BotstatsModel,
ContentModel,
Expand Down
4 changes: 2 additions & 2 deletions api/src/attachment/controllers/attachment.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ export class AttachmentController extends BaseController<Attachment> {
async findOne(@Param('id') id: string): Promise<Attachment> {
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;
}
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/contents/ContentImportDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const ContentImportDialog: FC<ContentImportDialogProps> = ({
closeDialog,
...rest
}) => {
const [attachmentId, setAttachementId] = useState<string | null>(null);
const [attachmentId, setAttachmentId] = useState<string | null>(null);
const { t } = useTranslate();
const { toast } = useToast();
const { apiClient } = useApiClient();
Expand All @@ -58,7 +58,7 @@ export const ContentImportDialog: FC<ContentImportDialogProps> = ({
);
const handleCloseDialog = () => {
closeDialog();
setAttachementId(null);
setAttachmentId(null);
};
const handleImportClick = () => {
if (attachmentId && data?.contentType?.id) {
Expand All @@ -76,7 +76,7 @@ export const ContentImportDialog: FC<ContentImportDialogProps> = ({
format="basic"
accept="text/csv"
onChange={(id, _) => {
setAttachementId(id);
setAttachmentId(id);
}}
label=""
value={attachmentId}
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/nlp/NlpImportDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const NlpImportDialog: FC<NlpImportDialogProps> = ({
closeDialog,
...rest
}) => {
const [attachmentId, setAttachementId] = useState<string | null>(null);
const [attachmentId, setAttachmentId] = useState<string | null>(null);
const { t } = useTranslate();
const queryClient = useQueryClient();
const { toast } = useToast();
Expand Down Expand Up @@ -63,7 +63,7 @@ export const NlpImportDialog: FC<NlpImportDialogProps> = ({
);
const handleCloseDialog = () => {
closeDialog();
setAttachementId(null);
setAttachmentId(null);
};

return (
Expand All @@ -76,7 +76,7 @@ export const NlpImportDialog: FC<NlpImportDialogProps> = ({
format="basic"
accept="text/csv"
onChange={(id, _) => {
setAttachementId(id);
setAttachmentId(id);
}}
label=""
value={attachmentId}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/visual-editor/form/MessageForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const MessageForm = () => {
{/* TEXT BLOCK */}
{Array.isArray(block?.message) ? <TextMessageForm /> : null}

{/* ATTACHEMENT BLOCK */}
{/* ATTACHMENT BLOCK */}
{block?.message && "attachment" in block?.message ? (
<AttachmentMessageForm />
) : null}
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/services/api.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/types/message.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export enum FileType {
unknown = "unknown",
}

// Attachements
// Attachments
export interface AttachmentAttrs {
name: string;
type: string;
Expand Down

0 comments on commit 15eee17

Please sign in to comment.