Skip to content

Commit

Permalink
Treat RO/TO pertinence, motivation, resources values as numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
nas-tabchiche committed Dec 6, 2024
1 parent a137114 commit 821b0fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions frontend/src/lib/utils/crud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -637,9 +637,9 @@ export const URL_MODEL_MAP: ModelMap = {
],
selectFields: [
{ field: 'risk-origin' },
{ field: 'motivation' },
{ field: 'resources' },
{ field: 'pertinence' }
{ field: 'motivation', valueType: 'number' },
{ field: 'resources', valueType: 'number' },
{ field: 'pertinence', valueType: 'number' }
]
}
};
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/lib/utils/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,9 @@ export const roToSchema = z.object({
feared_events: z.string().uuid().array(),
risk_origin: z.string(),
target_objective: z.string(),
motivation: z.string().optional(),
resources: z.string().optional(),
pertinence: z.string().optional(),
motivation: z.number().default(0).optional(),
resources: z.number().default(0).optional(),
pertinence: z.number().default(0).optional(),
activity: z.number().min(0).max(4).optional().default(0),
is_selected: z.boolean().optional().default(false),
justification: z.string().optional()
Expand Down

0 comments on commit 821b0fe

Please sign in to comment.