Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallow null elements in support array #203

Merged
merged 2 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading