Skip to content

Commit 234f60c

Browse files
committed
fix: validation for carer not selected
1 parent 5025e5f commit 234f60c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/frontend/src/components/questionnaire/calendar/EntryForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ export function EntityForm({ onSave, onDelete, onAddCarer, onAddLanguage, action
5353
initialValues: {
5454
startedAt: "",
5555
endedAt: "",
56-
carer: 0,
56+
carer: -1,
5757
weekday: 0,
5858
entryLanguages: [{ ratio: 100 }],
5959
},
6060
validate: {
6161
startedAt: isNotEmpty(t.validationNotEmpty),
6262
endedAt: isNotEmpty(t.validationNotEmpty),
63-
carer: isNotEmpty(t.validationNotEmpty),
63+
carer: (value) => (value === -1 || !value ? t.validationNotEmpty : undefined),
6464
entryLanguages: {
6565
ratio: (value) => {
6666
const fieldError = isInRange({ min: 1, max: 100 }, t.validationRatio)(value);

0 commit comments

Comments
 (0)