bcgov / EPIC.track

Integration of formsflow.ai to EPIC for administration support
Apache License 2.0
4 stars 16 forks source link

Fix work form save bug when simple_name is null (#2313) #2318

Closed MarkFeleaMotetGov closed 1 month ago

MarkFeleaMotetGov commented 1 month ago

The issue was that the Minister's Designation for Aspen Solar and Energy Storage somehow has a simple_name of null instead of an empty string like the other works do by default.

In components/work/WorkForm/index.tsx there is a format check using yup schema which has this requirement:

simple_title: yup.string()

This check fails when simple_string is null, which prevented the form from submitting altogether. The fix was when fetching the work data to manually set simple_name to an empty string if it was null.