mirror of
https://github.com/Shadowfita/docmost.git
synced 2025-11-18 10:41:04 +10:00
feat: spaces - WIP
This commit is contained in:
@ -31,16 +31,24 @@ export class UserService {
|
||||
|
||||
user = await this.userRepository.save(user);
|
||||
|
||||
//TODO: only create workspace if it is not a signup to an existing workspace
|
||||
await this.workspaceService.create(user.id);
|
||||
await this.workspaceService.createOrJoinWorkspace(user.id);
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
async getUserInstance(userId: string) {
|
||||
const user: User = await this.findById(userId);
|
||||
|
||||
if (!user) {
|
||||
throw new NotFoundException('User not found');
|
||||
}
|
||||
|
||||
const workspace: Workspace =
|
||||
await this.workspaceService.getUserCurrentWorkspace(userId);
|
||||
|
||||
if (!workspace) {
|
||||
throw new NotFoundException('Workspace not found');
|
||||
}
|
||||
return { user, workspace };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user