Skip to content

Commit c31c36a

Browse files
committed
fix(dref-final-report-form): add schema for NS Actions
1 parent 4c65e92 commit c31c36a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

app/src/views/DrefFinalReportForm/schema.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ const schema: FinalReportFormSchema = {
201201
national_authorities: {},
202202
un_or_other_actor: {},
203203
is_there_major_coordination_mechanism: {},
204+
has_national_society_conducted: {},
204205

205206
// OPERATION
206207
total_dref_allocation: {},
@@ -426,6 +427,23 @@ const schema: FinalReportFormSchema = {
426427
},
427428
);
428429

430+
formFields = addCondition(
431+
formFields,
432+
formValue,
433+
['has_national_society_conducted'],
434+
['national_society_conducted_description'],
435+
(val): Pick<FinalReportFormSchemaFields, 'national_society_conducted_description'> => {
436+
if (val?.has_national_society_conducted) {
437+
return {
438+
national_society_conducted_description: {},
439+
};
440+
}
441+
return {
442+
national_society_conducted_description: { forceValue: nullValue },
443+
};
444+
},
445+
);
446+
429447
type ActionsDrefTypeRelatedFields = Pick<FinalReportFormSchemaFields, 'needs_identified' | 'event_scope'>;
430448
formFields = addCondition(
431449
formFields,

0 commit comments

Comments
 (0)