mirror of
https://github.com/docmost/docmost.git
synced 2026-08-28 01:07:08 +08:00
20 lines
604 B
TypeScript
20 lines
604 B
TypeScript
import { ModuleRef } from '@nestjs/core';
|
|
|
|
export async function provisionPersonalSpaceForNewUser(
|
|
moduleRef: ModuleRef,
|
|
userId: string,
|
|
workspaceId: string,
|
|
): Promise<void> {
|
|
try {
|
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
const personalSpaceModule = require('../../ee/personal-space/services/personal-space.service');
|
|
const personalSpaceService = moduleRef.get(
|
|
personalSpaceModule.PersonalSpaceService,
|
|
{ strict: false },
|
|
);
|
|
await personalSpaceService.provisionForNewUser(userId, workspaceId);
|
|
} catch {
|
|
// module not found
|
|
}
|
|
}
|