Skip to content

Commit 48aff08

Browse files
committed
Update setError while submitting DREF form
1 parent ca7c9c6 commit 48aff08

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

app/src/views/DrefApplicationForm/index.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,16 @@ export function Component() {
360360
const [index] = match;
361361
return value?.planned_interventions?.[index]?.client_id;
362362
}
363+
match = matchArray(locations, ['source_information', NUM, 'source_link', NUM]);
364+
if (isDefined(match)) {
365+
const [index] = match;
366+
return value?.source_information?.[index]?.source_link;
367+
}
368+
match = matchArray(locations, ['source_information', NUM]);
369+
if (isDefined(match)) {
370+
const [index] = match;
371+
return value?.source_information?.[index]?.client_id;
372+
}
363373
return undefined;
364374
},
365375
));
@@ -438,6 +448,16 @@ export function Component() {
438448
const [index] = match;
439449
return value?.planned_interventions?.[index]?.client_id;
440450
}
451+
match = matchArray(locations, ['source_information', NUM, 'source_link', NUM]);
452+
if (isDefined(match)) {
453+
const [index] = match;
454+
return value?.source_information?.[index]?.source_link;
455+
}
456+
match = matchArray(locations, ['source_information', NUM]);
457+
if (isDefined(match)) {
458+
const [index] = match;
459+
return value?.source_information?.[index]?.client_id;
460+
}
441461
return undefined;
442462
},
443463
));

0 commit comments

Comments
 (0)