diff --git a/frontend/src/lib/utils/crud.ts b/frontend/src/lib/utils/crud.ts index fd8a9eb652..b0e762ebeb 100644 --- a/frontend/src/lib/utils/crud.ts +++ b/frontend/src/lib/utils/crud.ts @@ -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' } ] } }; diff --git a/frontend/src/lib/utils/schemas.ts b/frontend/src/lib/utils/schemas.ts index 318ac0c561..ed65b698de 100644 --- a/frontend/src/lib/utils/schemas.ts +++ b/frontend/src/lib/utils/schemas.ts @@ -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()