From 8caa1e242c2e127fb30a01d390212e3f1e930506 Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Wed, 7 Aug 2024 16:34:55 +0200 Subject: [PATCH] feat: transactional project service support (#7799) --- src/lib/services/index.ts | 4 ++++ src/lib/types/services.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/src/lib/services/index.ts b/src/lib/services/index.ts index b05f97211d7a..12a8523150e6 100644 --- a/src/lib/services/index.ts +++ b/src/lib/services/index.ts @@ -300,6 +300,9 @@ export const createServices = ( const projectService = db ? createProjectService(db, config) : createFakeProjectService(config); + const transactionalProjectService = db + ? withTransactional((db: Db) => createProjectService(db, config), db) + : withFakeTransactional(createFakeProjectService(config)); const projectInsightsService = db ? createProjectInsightsService(db, config) : createFakeProjectInsightsService().projectInsightsService; @@ -398,6 +401,7 @@ export const createServices = ( featureTypeService, healthService, projectService, + transactionalProjectService, strategyService, tagTypeService, transactionalTagTypeService, diff --git a/src/lib/types/services.ts b/src/lib/types/services.ts index 1b83349f6559..99c31a146abd 100644 --- a/src/lib/types/services.ts +++ b/src/lib/types/services.ts @@ -78,6 +78,7 @@ export interface IUnleashServices { healthService: HealthService; projectHealthService: ProjectHealthService; projectService: ProjectService; + transactionalProjectService: WithTransactional; playgroundService: PlaygroundService; frontendApiService: FrontendApiService; publicSignupTokenService: PublicSignupTokenService;