Allen-ISD-Computer-Science / IRL_DutySchedule_2024

Other
3 stars 0 forks source link

Nullify SupplementaryJSON #1

Closed ryanhallock closed 11 months ago

ryanhallock commented 11 months ago

Explanation

Currently we use a default of "{}" on all supplementary fields. But the default data is considered worthless. We still have to check if the data even exists inside the supplementary. We should use the absence of data or null to ensure that instead of wasting a default.

Effects of Change

Doing this change will allow us to use OptionalField on Fluent, so our backend doesnt error if we are trying to parse a content with only "{}" when it is expecting some fields. Instead the field will be nil on the backend or null on the frontend. Doing this might require an additional step on the backend/frontend to check to see if the supplementary exists when it is accessed or mutated.

CSAllenISD commented 11 months ago

Fixed: https://github.com/Allen-ISD-Computer-Science/IRL_DutySchedule_2024/commit/3263bd4a0023e15b66a479e37d6c4b42dd7e69c1