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';
|
} from '../features/change-request-segment-usage-service/createChangeRequestSegmentUsageReadModel';
|
||||||
import ConfigurationRevisionService from '../features/feature-toggle/configuration-revision-service';
|
import ConfigurationRevisionService from '../features/feature-toggle/configuration-revision-service';
|
||||||
import {
|
import {
|
||||||
|
createAccessService,
|
||||||
createEnvironmentService,
|
createEnvironmentService,
|
||||||
createEventsService,
|
createEventsService,
|
||||||
|
createFakeAccessService,
|
||||||
createFakeEnvironmentService,
|
createFakeEnvironmentService,
|
||||||
createFakeEventsService,
|
createFakeEventsService,
|
||||||
createFakeProjectService,
|
createFakeProjectService,
|
||||||
@ -165,6 +167,11 @@ export const createServices = (
|
|||||||
? createEventsService(db, config)
|
? createEventsService(db, config)
|
||||||
: createFakeEventsService(config, stores);
|
: createFakeEventsService(config, stores);
|
||||||
const groupService = new GroupService(stores, config, eventService);
|
const groupService = new GroupService(stores, config, eventService);
|
||||||
|
|
||||||
|
const transactionalAccessService = db
|
||||||
|
? withTransactional((db) => createAccessService(db, config), db)
|
||||||
|
: withFakeTransactional(createFakeAccessService(config).accessService);
|
||||||
|
|
||||||
const accessService = new AccessService(
|
const accessService = new AccessService(
|
||||||
stores,
|
stores,
|
||||||
config,
|
config,
|
||||||
@ -411,6 +418,7 @@ export const createServices = (
|
|||||||
: createFakePersonalDashboardService(config);
|
: createFakePersonalDashboardService(config);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
transactionalAccessService,
|
||||||
accessService,
|
accessService,
|
||||||
accountService,
|
accountService,
|
||||||
addonService,
|
addonService,
|
||||||
|
@ -59,6 +59,7 @@ import type { OnboardingService } from '../features/onboarding/onboarding-servic
|
|||||||
import type { PersonalDashboardService } from '../features/personal-dashboard/personal-dashboard-service';
|
import type { PersonalDashboardService } from '../features/personal-dashboard/personal-dashboard-service';
|
||||||
|
|
||||||
export interface IUnleashServices {
|
export interface IUnleashServices {
|
||||||
|
transactionalAccessService: WithTransactional<AccessService>;
|
||||||
accessService: AccessService;
|
accessService: AccessService;
|
||||||
accountService: AccountService;
|
accountService: AccountService;
|
||||||
addonService: AddonService;
|
addonService: AddonService;
|
||||||
|
Loading…
Reference in New Issue
Block a user