Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(modele): correction de la création des modèles #1393

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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!,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Du coup, on rajoute ça vu que ça peut être optionnel

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 @@ -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(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dans quel cas l'id n'est pas défini en fait ? Car sinon on peut modifier le type de base

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il n'est pas présent dans le cas de la création. On peut modifier un autre type en effet, mais hier dans le feu de l'action j'ai été au plus simple.

title: z
.string({ required_error: "Un titre doit être renseigné" })
.min(1, "Un titre doit être renseigné"),
Expand Down
Loading