From 444a73fde1f9f7e46087dbb00100dd5eaff3b321 Mon Sep 17 00:00:00 2001 From: TomDijkema Date: Thu, 5 Dec 2024 08:48:10 +0100 Subject: [PATCH] Fix MAS Job Records not being displayed in MAS overview Fix MAS Job Records not being displayed in MAS overview --- src/api/digitalMedia/GetDigitalMediaMasJobRecords.ts | 6 +++--- src/api/digitalSpecimen/GetDigitalSpecimenMasJobRecords.ts | 6 +++--- .../components/masMenu/components/MasOverview.tsx | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/api/digitalMedia/GetDigitalMediaMasJobRecords.ts b/src/api/digitalMedia/GetDigitalMediaMasJobRecords.ts index 2bd0897e..3389b6c8 100644 --- a/src/api/digitalMedia/GetDigitalMediaMasJobRecords.ts +++ b/src/api/digitalMedia/GetDigitalMediaMasJobRecords.ts @@ -2,7 +2,7 @@ import axios from 'axios'; /* Import Types */ -import { JSONResultArray, Dict } from 'app/Types'; +import { MasJobRecord, JSONResultArray, Dict } from 'app/Types'; /* Import Exceptions */ import { NotFoundException } from 'app/Exceptions'; @@ -16,7 +16,7 @@ import { NotFoundException } from 'app/Exceptions'; */ const GetDigitalMediaMasJobRecords = async ({ handle, pageSize, pageNumber, state }: { handle: string, pageSize?: number, pageNumber: number, state?: string }) => { let returnData: { - masJobRecords: Dict[], + masJobRecords: MasJobRecord[], links?: Dict } = { masJobRecords: [] @@ -41,7 +41,7 @@ const GetDigitalMediaMasJobRecords = async ({ handle, pageSize, pageNumber, stat const data: JSONResultArray = result.data; data.data.forEach(dataFragment => { - returnData.masJobRecords.push(dataFragment.attributes); + returnData.masJobRecords.push(dataFragment.attributes as MasJobRecord); }); /* Set return data */ diff --git a/src/api/digitalSpecimen/GetDigitalSpecimenMasJobRecords.ts b/src/api/digitalSpecimen/GetDigitalSpecimenMasJobRecords.ts index adf8be36..4a5596bd 100644 --- a/src/api/digitalSpecimen/GetDigitalSpecimenMasJobRecords.ts +++ b/src/api/digitalSpecimen/GetDigitalSpecimenMasJobRecords.ts @@ -2,7 +2,7 @@ import axios from 'axios'; /* Import Types */ -import { JSONResultArray, Dict } from 'app/Types'; +import { MasJobRecord, JSONResultArray, Dict } from 'app/Types'; /* Import Exceptions */ import { NotFoundException } from 'app/Exceptions'; @@ -16,7 +16,7 @@ import { NotFoundException } from 'app/Exceptions'; */ const GetDigitalSpecimenMasJobRecords = async ({ handle, pageSize, pageNumber, state }: { handle: string, pageSize?: number, pageNumber: number, state?: string }) => { let returnData: { - masJobRecords: Dict[], + masJobRecords: MasJobRecord[], links?: Dict } = { masJobRecords: [] @@ -41,7 +41,7 @@ const GetDigitalSpecimenMasJobRecords = async ({ handle, pageSize, pageNumber, s const data: JSONResultArray = result.data; data.data.forEach(dataFragment => { - returnData.masJobRecords.push(dataFragment.attributes); + returnData.masJobRecords.push(dataFragment.attributes as MasJobRecord); }); /* Set return data */ diff --git a/src/components/elements/annotationSidePanel/components/masMenu/components/MasOverview.tsx b/src/components/elements/annotationSidePanel/components/masMenu/components/MasOverview.tsx index beec4e23..cfc5c579 100644 --- a/src/components/elements/annotationSidePanel/components/masMenu/components/MasOverview.tsx +++ b/src/components/elements/annotationSidePanel/components/masMenu/components/MasOverview.tsx @@ -41,7 +41,7 @@ const MasOverview = (props: Props) => { /* Hooks */ const pagination = usePagination({ pageSize: 25, - resultKey: 'MasJobRecords', + resultKey: 'masJobRecords', params: { handle: digitalObjectId, state: masJobRecordStateFilter