File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
AdminUI/LearningHub.Nhs.AdminUI/Controllers Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,15 @@ public async Task<IActionResult> Details(UserGroupAdminDetailViewModel userGroup
197197 if ( userGroup . IsNew ( ) )
198198 {
199199 validationResult = await this . userGroupService . CreateUserGroup ( userGroup ) ;
200- userGroup = await this . userGroupService . GetUserGroupAdminDetailbyIdAsync ( validationResult . CreatedId . Value ) ;
200+ if ( validationResult . IsValid )
201+ {
202+ userGroup = await this . userGroupService . GetUserGroupAdminDetailbyIdAsync ( validationResult . CreatedId . Value ) ;
203+ }
204+ else
205+ {
206+ this . ViewBag . ErrorMessage = $ "Update failed: { string . Join ( Environment . NewLine , validationResult . Details ) } ";
207+ return this . View ( "Details" , userGroup ) ;
208+ }
201209 }
202210 else
203211 {
You can’t perform that action at this time.
0 commit comments