Skip to content

Commit

Permalink
Merge pull request #203 from UN-OCHA/remove-null-support
Browse files Browse the repository at this point in the history
Disallow `null` elements in `support` array
  • Loading branch information
enxtur authored Jan 22, 2025
2 parents fc9aa70 + 5f74f6c commit 5206bd1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unocha/hpc-api-core",
"version": "10.7.1",
"version": "10.7.2",
"description": "Core libraries supporting HPC.Tools API Backend",
"license": "Apache-2.0",
"private": false,
Expand Down
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 5206bd1

Please sign in to comment.