File tree Expand file tree Collapse file tree
packages/server/api/src/app/authentication/new-user Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,21 +32,12 @@ export async function assignDefaultOrganization(user: User): Promise<void> {
3232 } ) ;
3333
3434 const updatedUser = await userService . getOneOrFail ( { id : user . id } ) ;
35- const project = await projectService . getOneForUser ( updatedUser ) ;
35+ const project = await projectService . getUserProjectOrThrow ( updatedUser . id ) ;
3636
37- if ( ! isNil ( project ) ) {
38- await addUserToDefaultWorkspace ( {
39- email : user . email ,
40- workspaceId : project . tablesWorkspaceId ,
41- } ) ;
42- } else {
43- throw new ApplicationError ( {
44- code : ErrorCode . ENTITY_NOT_FOUND ,
45- params : {
46- message : 'No project found for user' ,
47- } ,
48- } ) ;
49- }
37+ await addUserToDefaultWorkspace ( {
38+ email : user . email ,
39+ workspaceId : project . tablesWorkspaceId ,
40+ } ) ;
5041}
5142
5243async function addUserToDefaultWorkspace ( values : {
You can’t perform that action at this time.
0 commit comments