Skip to content

Commit

Permalink
fix: url can be empty
Browse files Browse the repository at this point in the history
  • Loading branch information
m-maillot committed Oct 9, 2023
1 parent 10864fa commit 3ac2d7a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions targets/frontend/src/components/contributions/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ export type LegiReference = z.infer<typeof legiReferenceSchema>;
export const otherReferenceSchema = z.object({
label: z
.string({ required_error: "un libellé doit être renseigner" })
.min(1, "un libellé doit être renseigner"),
.min(1, "un nom doit être renseigné"),
url: z
.string({ required_error: "Une url doit être renseigner" })
.url("le format de l'url est invalide"),
.string({ required_error: "Une url doit être renseigné" })
.url("le format du lien est invalide")
.optional()
.or(z.literal("")),
});
export type OtherReference = z.infer<typeof otherReferenceSchema>;

Expand Down

0 comments on commit 3ac2d7a

Please sign in to comment.