diff --git a/coral/src/domain/requests/requests-transformers.test.ts b/coral/src/domain/requests/requests-transformers.test.ts index 86d6a8cf93..11a5d4a021 100644 --- a/coral/src/domain/requests/requests-transformers.test.ts +++ b/coral/src/domain/requests/requests-transformers.test.ts @@ -23,16 +23,6 @@ const mockedRequestsWaitingForApprovalMissingAcl: RequestsWaitingForApprovalWith TOTAL_NOTIFICATIONS: 8, }; -const defaultRecord = { - TOPIC: 0, - ACL: 0, - SCHEMA: 0, - CONNECTOR: 0, - USER: 0, - OPERATIONAL: 0, - TOTAL_NOTIFICATIONS: 0, -}; - const mockApiResponse: KlawApiResponse<"getRequestStatistics"> = { requestEntityStatistics: [ { @@ -381,14 +371,6 @@ describe("request-transformers.ts", () => { expect(response).toEqual(mockedRequestsWaitingForApproval); }); - it("should return record with default data if API response is undefined", () => { - const response = getRequestsWaitingForApprovalTransformer({ - requestEntityStatistics: undefined, - }); - - expect(response).toEqual(defaultRecord); - }); - it("should return record with default data for single entity type if API response misses that data", () => { const response = getRequestsWaitingForApprovalTransformer( mockApiResponseMissingAcl diff --git a/coral/src/domain/requests/requests-transformers.ts b/coral/src/domain/requests/requests-transformers.ts index e60795ff53..3ed70b8582 100644 --- a/coral/src/domain/requests/requests-transformers.ts +++ b/coral/src/domain/requests/requests-transformers.ts @@ -16,20 +16,9 @@ const getRequestsWaitingForApprovalTransformer = ( TOTAL_NOTIFICATIONS: 0, }; - if (requestEntityStatistics === undefined) { - return requestsWaitingForApproval; - } - requestEntityStatistics.forEach((statistics) => { const { requestEntityType, requestStatusCountSet } = statistics; - if ( - requestEntityType === undefined || - requestStatusCountSet === undefined - ) { - return; - } - const amountOfRequestsForEntity = requestStatusCountSet.find( (requestStatusCountSet) => diff --git a/coral/types/api.d.ts b/coral/types/api.d.ts index 8d73b1a3c0..a0e5ea5609 100644 --- a/coral/types/api.d.ts +++ b/coral/types/api.d.ts @@ -3167,8 +3167,8 @@ export type operations = { }; }; responses: { - /** @description default response */ - default: { + /** @description OK */ + 200: { content: { "application/json": components["schemas"]["RequestsCountOverview"]; };