From ee794fc00c78c085898153eef13145e9930aead3 Mon Sep 17 00:00:00 2001 From: Rishabh Verma Date: Sun, 19 Apr 2020 21:07:05 +0530 Subject: [PATCH] fix: redirect to view user after submitting create user form (#558) Fixes: #557 --- src/app/users/create-user/create-user.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/users/create-user/create-user.component.ts b/src/app/users/create-user/create-user.component.ts index 838a2a452..5997138a9 100644 --- a/src/app/users/create-user/create-user.component.ts +++ b/src/app/users/create-user/create-user.component.ts @@ -105,12 +105,12 @@ export class CreateUserComponent implements OnInit { /** * Submits the user form and creates user, - * if successful redirects to users. + * if successful redirects to view created user. */ submit() { const user = this.userForm.value; this.usersService.createUser(user).subscribe((response: any) => { - this.router.navigate(['../'], { relativeTo: this.route }); + this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); }); }