diff --git a/targets/frontend/src/modules/documents/api/documents.service.ts b/targets/frontend/src/modules/documents/api/documents.service.ts index 9b9e31cd0..b35dabd3b 100644 --- a/targets/frontend/src/modules/documents/api/documents.service.ts +++ b/targets/frontend/src/modules/documents/api/documents.service.ts @@ -126,7 +126,7 @@ export class DocumentsService { ): HasuraDocument { return { cdtn_id: document?.cdtn_id ?? generateCdtnId(data.title), - initial_id: data.id, + initial_id: data.id!, source: "modeles_de_courriers", meta_description: data.metaDescription, title: data.title, diff --git a/targets/frontend/src/modules/models/components/Common/Form.tsx b/targets/frontend/src/modules/models/components/Common/Form.tsx index 7461292c2..6e746db70 100644 --- a/targets/frontend/src/modules/models/components/Common/Form.tsx +++ b/targets/frontend/src/modules/models/components/Common/Form.tsx @@ -209,7 +209,7 @@ export const ModelForm = ({ }, { label: "Lettre", - value: "letter", + value: "lettre", }, ]} /> diff --git a/targets/frontend/src/modules/models/type.ts b/targets/frontend/src/modules/models/type.ts index 49a466883..a5a4bfe74 100644 --- a/targets/frontend/src/modules/models/type.ts +++ b/targets/frontend/src/modules/models/type.ts @@ -6,7 +6,7 @@ import { import { fileSchema } from "../common/type"; export const modelSchema = z.object({ - id: z.string().uuid(), + id: z.string().uuid().optional(), title: z .string({ required_error: "Un titre doit être renseigné" }) .min(1, "Un titre doit être renseigné"),