fix: redirect to view user after submitting create user form (#558)

Fixes: #557
This commit is contained in:
Rishabh Verma
2020-04-19 21:07:05 +05:30
committed by GitHub
parent cbefd744fe
commit ee794fc00c
@@ -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 });
});
}