File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
backend/LexBoxApi/Services Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -53,19 +53,18 @@ public async Task<Guid> CreateProject(CreateProjectInput input)
5353 } ) ;
5454 // Also delete draft project, if any
5555 await dbContext . DraftProjects . Where ( dp => dp . Id == projectId ) . ExecuteDeleteAsync ( ) ;
56- if ( input . ProjectManagerId . HasValue )
57- {
58- var manager = await dbContext . Users . FindAsync ( input . ProjectManagerId . Value ) ;
59- manager ? . UpdateCreateProjectsPermission ( ProjectRole . Manager ) ;
60- if ( draftProject != null && manager != null )
61- {
62- await emailService . SendApproveProjectRequestEmail ( manager , input ) ;
63- }
64- }
56+
57+ var manager = input . ProjectManagerId . HasValue ? await dbContext . Users . FindAsync ( input . ProjectManagerId . Value ) : null ;
58+ manager ? . UpdateCreateProjectsPermission ( ProjectRole . Manager ) ;
59+
6560 await dbContext . SaveChangesAsync ( ) ;
6661 await hgService . InitRepo ( input . Code ) ;
6762 InvalidateProjectOrgIdsCache ( projectId ) ;
6863 InvalidateProjectConfidentialityCache ( projectId ) ;
64+ if ( draftProject != null && manager != null )
65+ {
66+ await emailService . SendApproveProjectRequestEmail ( manager , input ) ;
67+ }
6968 await transaction . CommitAsync ( ) ;
7069 return projectId ;
7170 }
You can’t perform that action at this time.
0 commit comments