From 5d3b03c64fe26a4933348dbf7a69434c55a05286 Mon Sep 17 00:00:00 2001 From: Marek Libra Date: Thu, 11 Jan 2024 08:18:20 +0100 Subject: [PATCH] chore: fix handling of promises in tests --- .../src/service/handlers.test.ts | 11 +++-------- plugins/notifications-frontend/src/openapi/runtime.ts | 5 +---- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/plugins/notifications-backend/src/service/handlers.test.ts b/plugins/notifications-backend/src/service/handlers.test.ts index 21524dc7c8..db103a61de 100644 --- a/plugins/notifications-backend/src/service/handlers.test.ts +++ b/plugins/notifications-backend/src/service/handlers.test.ts @@ -210,14 +210,9 @@ describe('handlers', () => { {}, ); - const setReadPromises: Promise[] = []; - - resultGet.forEach(async notification => { - setReadPromises.push( - setRead(dbClient, catalogUser, notification.id, true), - ); - }); - + const setReadPromises: Promise[] = resultGet.map(notification => + setRead(dbClient, catalogUser, notification.id, true), + ); await Promise.all(setReadPromises); const resultGetRead = await getNotifications( diff --git a/plugins/notifications-frontend/src/openapi/runtime.ts b/plugins/notifications-frontend/src/openapi/runtime.ts index 90ca48f287..c03f16d4d7 100644 --- a/plugins/notifications-frontend/src/openapi/runtime.ts +++ b/plugins/notifications-frontend/src/openapi/runtime.ts @@ -13,10 +13,7 @@ * Do not edit the class manually. */ -export const BASE_PATH = 'http://localhost:7007/api/notifications'.replace( - /\/+$/, - '', -); +export const BASE_PATH = 'http://localhost:7007/api/notifications'; export interface ConfigurationParameters { basePath?: string; // override base path