From b4cd9149ab43915fb8c7935bf832050de38f2cf9 Mon Sep 17 00:00:00 2001 From: Simen Fivelstad Smaaberg <66635118+simensma-fresh@users.noreply.github.com> Date: Tue, 17 Dec 2024 23:46:04 +0000 Subject: [PATCH] Fixed typing issues --- .../src/interfaces/permits/permitCondition.interface.ts | 2 +- services/common/src/redux/slices/permitServiceSlice.ts | 4 +++- .../mine/Permit/PreviewPermitAmendmentDocument.spec.tsx | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/services/common/src/interfaces/permits/permitCondition.interface.ts b/services/common/src/interfaces/permits/permitCondition.interface.ts index 09398bbd25..69bbcc5118 100644 --- a/services/common/src/interfaces/permits/permitCondition.interface.ts +++ b/services/common/src/interfaces/permits/permitCondition.interface.ts @@ -15,7 +15,7 @@ export interface IBoundingBox { } export interface IPermitConditionMeta { page: number; - role: string; + role?: string; bounding_box?: IBoundingBox; } export interface IPermitCondition { diff --git a/services/common/src/redux/slices/permitServiceSlice.ts b/services/common/src/redux/slices/permitServiceSlice.ts index a6d4f982e7..a4c0e17e7d 100644 --- a/services/common/src/redux/slices/permitServiceSlice.ts +++ b/services/common/src/redux/slices/permitServiceSlice.ts @@ -144,10 +144,11 @@ const permitServiceSlice = createAppSlice({ { fulfilled: (state, action) => { const { permit_amendment_id } = action.meta.arg; - const { task_id, task_status } = action.payload; + const { task_id, task_status, permit_amendment_document_guid } = action.payload; state.extractions[permit_amendment_id] = { task_id: task_id, task_status: permitExtractionStatusMap[task_status], + permit_amendment_document_guid }; }, rejected: (state, action) => { @@ -176,6 +177,7 @@ const permitServiceSlice = createAppSlice({ state.extractions[permit_amendment_id] = { task_status: PermitExtractionStatus.not_started, task_id: null, + permit_amendment_document_guid: null, }; }, rejected: (state, action) => { diff --git a/services/core-web/src/tests/components/mine/Permit/PreviewPermitAmendmentDocument.spec.tsx b/services/core-web/src/tests/components/mine/Permit/PreviewPermitAmendmentDocument.spec.tsx index fbfdf0adb2..0352780532 100644 --- a/services/core-web/src/tests/components/mine/Permit/PreviewPermitAmendmentDocument.spec.tsx +++ b/services/core-web/src/tests/components/mine/Permit/PreviewPermitAmendmentDocument.spec.tsx @@ -4,6 +4,7 @@ import { getDocument } from "@mds/common/redux/utils/actionlessNetworkCalls"; import { ReduxWrapper } from "@mds/common/tests/utils/ReduxWrapper"; import { PreviewPermitAmendmentDocument } from "@/components/mine/Permit/PreviewPermitAmendmentDocument"; import * as MOCK from "@mds/common/tests/mocks/dataMocks"; +import { IPermitCondition } from "@mds/common/interfaces"; jest.mock("@mds/common/redux/utils/actionlessNetworkCalls", () => ({ getDocument: jest.fn() @@ -11,7 +12,7 @@ jest.mock("@mds/common/redux/utils/actionlessNetworkCalls", () => ({ const mockPermitAmendment = MOCK.PERMITS[0].permit_amendments[0]; -const mockSelectedCondition = { +const mockSelectedCondition: IPermitCondition = { ...MOCK.PERMITS[0].permit_amendments[0].conditions[0], permit_condition_guid: "test-condition", meta: {