Skip to content

Commit

Permalink
front: fix decimals error for study budget
Browse files Browse the repository at this point in the history
Signed-off-by: Theo Macron <[email protected]>
  • Loading branch information
Akctarus committed Nov 15, 2024
1 parent 2cc9582 commit ca256f7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion front/public/locales/en/operationalStudies/study.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"confirmDeleteMessage_one": "Do you really want to delete {{count}} scenario?",
"confirmDeleteMessage_other": "Do you really want to delete the {{count}} scenarios?",
"studyBudget": "Budget",
"studyBudgetInvalid": "The budget for the study must not exceed 2147483647",
"studyBudgetInvalid": "The study budget must be a positive integer and must not exceed 2147483647",
"studyBusinessCode": "Business code",
"studyBusinessCodeInvalid": "The business code for the study must not exceed 128 characters",
"studyCancel": "Cancel",
Expand Down
2 changes: 1 addition & 1 deletion front/public/locales/fr/operationalStudies/study.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"byRecentDate": "Plus récents"
},
"studyBudget": "Budget",
"studyBudgetInvalid": "Le budget de l'étude ne doit pas dépasser 2147483647",
"studyBudgetInvalid": "Le budget de l'étude doit être un entier positif et ne doit pas dépasser 2147483647",
"studyBusinessCode": "Code affaire",
"studyBusinessCodeInvalid": "Le code affaire de l'étude ne doit pas dépasser 128 caractères",
"studyCancel": "Annuler",
Expand Down
3 changes: 2 additions & 1 deletion front/src/modules/study/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ export const checkStudyFields = (
description: isInvalidString(SMALL_TEXT_AREA_MAX_LENGTH, study.description),
business_code: isInvalidString(SMALL_INPUT_MAX_LENGTH, study.business_code),
service_code: isInvalidString(SMALL_INPUT_MAX_LENGTH, study.service_code),
budget: (study.budget ?? 0) > 2147483647,
budget:
(study.budget ?? 0) > 2147483647 || (!Number.isInteger(study.budget) && study.budget !== null),
});

0 comments on commit ca256f7

Please sign in to comment.