Skip to content

Commit

Permalink
fix(modele): correction de la création des modèles
Browse files Browse the repository at this point in the history
  • Loading branch information
m-maillot committed May 16, 2024
1 parent e26df23 commit b10a886
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class DocumentsService {
): HasuraDocument<any> {
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const ModelForm = ({
undefined
);

const { control, handleSubmit, setValue } = useForm<FormData>({
const { control, handleSubmit, setValue, formState } = useForm<FormData>({
defaultValues: {
...defaultValues,
...model,
Expand Down Expand Up @@ -209,7 +209,7 @@ export const ModelForm = ({
},
{
label: "Lettre",
value: "letter",
value: "lettre",
},
]}
/>
Expand Down
2 changes: 1 addition & 1 deletion targets/frontend/src/modules/models/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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é"),
Expand Down

0 comments on commit b10a886

Please sign in to comment.