From 966991a72abed5433b790a5eb8c65918428b3ead Mon Sep 17 00:00:00 2001 From: Tim van Oostrom Date: Thu, 9 Jan 2025 16:10:04 +0100 Subject: [PATCH] Fix typing --- src/server/services/decos/decos-service.ts | 4 ++-- src/server/services/decos/decos-types.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/services/decos/decos-service.ts b/src/server/services/decos/decos-service.ts index e1e675466..bd22f1cb5 100644 --- a/src/server/services/decos/decos-service.ts +++ b/src/server/services/decos/decos-service.ts @@ -216,7 +216,7 @@ async function transformDecosZaakResponse< decosZaakTransformer.fetchWorkflowStatusDatesFor.map( ({ status, stepTitle }) => ({ status, - datePublished: workFlowDates.content[stepTitle], + datePublished: workFlowDates.content?.[stepTitle] ?? null, }) ); } @@ -447,7 +447,7 @@ export async function fetchDecosWorkflowDates( requestID: RequestID, zaakID: DecosZaakBase['key'], stepTitles: DecosWorkflowStepTitle[] -): Promise>> { +): Promise | null>> { const apiConfigWorkflows = getApiConfig('DECOS_API', { formatUrl: (config) => { return `${config.url}/items/${zaakID}/workflows`; diff --git a/src/server/services/decos/decos-types.ts b/src/server/services/decos/decos-types.ts index 55d23e2fa..14b259ea3 100644 --- a/src/server/services/decos/decos-types.ts +++ b/src/server/services/decos/decos-types.ts @@ -124,7 +124,7 @@ export type DecosTransformerOptions = { decosZaakTransformer?: DecosZaakTransformer; fetchDecosWorkflowDates?: ( stepTitles: DecosWorkflowStepTitle[] - ) => Promise>>; + ) => Promise | null>>; }; export type DecosZaakTransformer = {