Skip to content

Commit

Permalink
Disallow null elements in support array
Browse files Browse the repository at this point in the history
After fixing all the records which had `null`
in `support` array, we can simplify the codec
  • Loading branch information
Pl217 committed Dec 30, 2024
1 parent 5ae055f commit c63465d
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/db/models/planEntityVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,7 @@ export const PLAN_ENTITY_VERSION_VALUE = t.type({
categories: t.array(CATEGORY_ID),
description: t.string,
type: LOCALIZED_PLURAL_STRING,
support: t.array(
t.union([
/**
* TODO: Some records in the database have `null` inside `support` array,
* which is problematic. Stricter validation of data being stored should
* be done, existing values removed and then `null` removed from this type.
*/
t.null,
PLAN_ENTITY_VERSION_REF,
])
),
support: t.array(PLAN_ENTITY_VERSION_REF),
});
export type PlanEntityVersionValue = t.TypeOf<typeof PLAN_ENTITY_VERSION_VALUE>;

Expand Down

0 comments on commit c63465d

Please sign in to comment.