mirror of
https://github.com/docmost/docmost.git
synced 2026-07-14 15:06:45 +10:00
feat: on-demand only
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
import { BadRequestException, Inject, Injectable } from '@nestjs/common';
|
||||
import { ModuleRef } from '@nestjs/core';
|
||||
import { provisionPersonalSpaceForNewUser } from '../../../common/helpers/personal-space-provisioning';
|
||||
import { CreateUserDto } from '../dto/create-user.dto';
|
||||
import { WorkspaceService } from '../../workspace/services/workspace.service';
|
||||
import { CreateWorkspaceDto } from '../../workspace/dto/create-workspace.dto';
|
||||
@@ -24,7 +22,6 @@ export class SignupService {
|
||||
private userRepo: UserRepo,
|
||||
private workspaceService: WorkspaceService,
|
||||
private groupUserRepo: GroupUserRepo,
|
||||
private moduleRef: ModuleRef,
|
||||
@InjectKysely() private readonly db: KyselyDB,
|
||||
@Inject(AUDIT_SERVICE) private readonly auditService: IAuditService,
|
||||
) {}
|
||||
@@ -92,14 +89,6 @@ export class SignupService {
|
||||
},
|
||||
});
|
||||
|
||||
if (!trx) {
|
||||
await provisionPersonalSpaceForNewUser(
|
||||
this.moduleRef,
|
||||
user.id,
|
||||
workspaceId,
|
||||
);
|
||||
}
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@ import {
|
||||
Logger,
|
||||
NotFoundException,
|
||||
} from '@nestjs/common';
|
||||
import { ModuleRef } from '@nestjs/core';
|
||||
import { provisionPersonalSpaceForNewUser } from '../../../common/helpers/personal-space-provisioning';
|
||||
import { AcceptInviteDto, InviteUserDto } from '../dto/invitation.dto';
|
||||
import { UserRepo } from '@docmost/db/repos/user/user.repo';
|
||||
import { InjectKysely } from 'nestjs-kysely';
|
||||
@@ -55,7 +53,6 @@ export class WorkspaceInvitationService {
|
||||
private domainService: DomainService,
|
||||
private tokenService: TokenService,
|
||||
private sessionService: SessionService,
|
||||
private moduleRef: ModuleRef,
|
||||
@InjectKysely() private readonly db: KyselyDB,
|
||||
@InjectQueue(QueueName.BILLING_QUEUE) private billingQueue: Queue,
|
||||
private readonly environmentService: EnvironmentService,
|
||||
@@ -313,12 +310,6 @@ export class WorkspaceInvitationService {
|
||||
return;
|
||||
}
|
||||
|
||||
await provisionPersonalSpaceForNewUser(
|
||||
this.moduleRef,
|
||||
newUser.id,
|
||||
workspace.id,
|
||||
);
|
||||
|
||||
// notify the inviter
|
||||
const invitedByUser = await this.userRepo.findById(
|
||||
invitation.invitedById,
|
||||
|
||||
+1
-1
Submodule apps/server/src/ee updated: 83316d0ba6...d20a3931cf
Reference in New Issue
Block a user