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: encodage des commentaires #454

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

gBusato
Copy link
Collaborator

@gBusato gBusato commented Oct 2, 2024

Encodage des champs commentaires qui pourraient être rejetés par le WAF

@gBusato gBusato force-pushed the fix/erreur-waf-commentaires branch 2 times, most recently from b4c322d to 7dc7c4c Compare October 2, 2024 08:09
@@ -15,16 +16,24 @@ export const submitDemandeSchema = {
compensationCfd: z.string().optional(),
compensationCodeDispositif: z.string().optional(),
compensationRentreeScolaire: z.coerce.number().optional(),
motif: z.array(z.string()).optional(),
autreMotif: z.string().optional(),
motif: z
Copy link
Collaborator

Choose a reason for hiding this comment

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

Pas nécessaire ici, la liste des motifs possibles est figée et controlée côté front (d'ailleurs on devrait peut-être utiliser une enum)

@@ -33,8 +42,13 @@ export const submitDemandeSchema = {
capaciteApprentissage: z.coerce.number().optional(),
capaciteApprentissageColoree: z.coerce.number().optional(),
statut: DemandeStatutZodType.exclude(["supprimée"]),
motifRefus: z.array(z.string()).optional(),
autreMotifRefus: z.string().optional(),
motifRefus: z
Copy link
Collaborator

Choose a reason for hiding this comment

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

même chose

@@ -22,8 +23,13 @@ export const submitIntentionSchema = {
capaciteApprentissage: z.coerce.number().optional(),
capaciteApprentissageColoree: z.coerce.number().optional(),
// Précisions
motif: z.array(z.string()).optional(),
autreMotif: z.string().optional(),
motif: z
Copy link
Collaborator

Choose a reason for hiding this comment

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

même chose

// Statut
statut: DemandeStatutZodType.exclude(["supprimée"]),
motifRefus: z.array(z.string()).optional(),
autreMotifRefus: z.string().optional(),
motifRefus: z
Copy link
Collaborator

Choose a reason for hiding this comment

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

même chose

numero: formId,
...values,
commentaire: escapeString(values.commentaire),
motif: values.motif?.map(
Copy link
Collaborator

Choose a reason for hiding this comment

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

même chose, pas nécessaire du coup

(motif) => escapeString(motif) as string
),
autreMotif: escapeString(values.autreMotif),
motifRefus: values.motifRefus?.map(
Copy link
Collaborator

Choose a reason for hiding this comment

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

même chose

numero: formId,
...values,
commentaire: escapeString(values.commentaire),
motif: values.motif?.map(
Copy link
Collaborator

Choose a reason for hiding this comment

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

même chose

(motif) => escapeString(motif) as string
),
autreMotif: escapeString(values.autreMotif),
motifRefus: values.motifRefus?.map(
Copy link
Collaborator

Choose a reason for hiding this comment

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

même chose

commentaire: escapeString(
values.commentaire
),
motif: values.motif?.map(
Copy link
Collaborator

Choose a reason for hiding this comment

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

même chose

(motif) => escapeString(motif) as string
),
autreMotif: escapeString(values.autreMotif),
motifRefus: values.motifRefus?.map(
Copy link
Collaborator

Choose a reason for hiding this comment

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

même chose

@gBusato gBusato force-pushed the fix/erreur-waf-commentaires branch from 7dc7c4c to 11ad305 Compare October 3, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants