Skip to content

Commit

Permalink
Make importInformation nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
Onitoxan committed Dec 4, 2024
1 parent 8e0ca36 commit 202daef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions apps/hpc-ftsadmin/src/app/utils/parse-flow-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ const isInferred = (
}

const inferredList = flow.externalReferences.map((eR) => {
if (!eR.importInformation.inferred) {
if (!eR.importInformation?.inferred) {
return false;
}
return eR.importInformation.inferred.some(
Expand All @@ -411,7 +411,7 @@ const isTransferred = (
}

const transferredList = flow.externalReferences.map((eR) => {
if (!eR.importInformation.transferred) {
if (!eR.importInformation?.transferred) {
return false;
}
return eR.importInformation.transferred.some(
Expand Down
11 changes: 7 additions & 4 deletions libs/hpc-data/src/lib/flows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,13 @@ const FLOW_REST_EXTERNAL_REFERENCE = t.type({
versionID: t.number,
createdAt: t.string,
updatedAt: t.string,
importInformation: t.partial({
inferred: t.array(FLOW_IMPORT_INFORMATION),
transferred: t.array(FLOW_IMPORT_INFORMATION),
}),
importInformation: t.union([
t.partial({
inferred: t.array(FLOW_IMPORT_INFORMATION),
transferred: t.array(FLOW_IMPORT_INFORMATION),
}),
t.null,
]),
});

const FLOW_REST_EXTERNAL_DATA = t.type({
Expand Down

0 comments on commit 202daef

Please sign in to comment.