feat: spaces - WIP

This commit is contained in:
Philipinho
2024-02-28 02:39:46 +00:00
parent 1d620eba49
commit 40251aef7d
32 changed files with 512 additions and 119 deletions

View File

@ -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 };
}