mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
feat: add transactional support for access service (#8311)
Continuing splitting #8271 into smaller pieces. This PR adds transactional support for access service.
This commit is contained in:
parent
60206f88d3
commit
ab81528536
@ -63,8 +63,10 @@ import {
|
||||
} from '../features/change-request-segment-usage-service/createChangeRequestSegmentUsageReadModel';
|
||||
import ConfigurationRevisionService from '../features/feature-toggle/configuration-revision-service';
|
||||
import {
|
||||
createAccessService,
|
||||
createEnvironmentService,
|
||||
createEventsService,
|
||||
createFakeAccessService,
|
||||
createFakeEnvironmentService,
|
||||
createFakeEventsService,
|
||||
createFakeProjectService,
|
||||
@ -165,6 +167,11 @@ export const createServices = (
|
||||
? createEventsService(db, config)
|
||||
: createFakeEventsService(config, stores);
|
||||
const groupService = new GroupService(stores, config, eventService);
|
||||
|
||||
const transactionalAccessService = db
|
||||
? withTransactional((db) => createAccessService(db, config), db)
|
||||
: withFakeTransactional(createFakeAccessService(config).accessService);
|
||||
|
||||
const accessService = new AccessService(
|
||||
stores,
|
||||
config,
|
||||
@ -411,6 +418,7 @@ export const createServices = (
|
||||
: createFakePersonalDashboardService(config);
|
||||
|
||||
return {
|
||||
transactionalAccessService,
|
||||
accessService,
|
||||
accountService,
|
||||
addonService,
|
||||
|
@ -59,6 +59,7 @@ import type { OnboardingService } from '../features/onboarding/onboarding-servic
|
||||
import type { PersonalDashboardService } from '../features/personal-dashboard/personal-dashboard-service';
|
||||
|
||||
export interface IUnleashServices {
|
||||
transactionalAccessService: WithTransactional<AccessService>;
|
||||
accessService: AccessService;
|
||||
accountService: AccountService;
|
||||
addonService: AddonService;
|
||||
|
Loading…
Reference in New Issue
Block a user