From 712de89751df74156eac8a2c69fa51beb231b492 Mon Sep 17 00:00:00 2001 From: Oktawian-L Date: Sun, 3 Nov 2019 19:59:15 +0100 Subject: [PATCH] Update user-edit.component.ts --- Subiton/src/app/users/user-edit/user-edit.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Subiton/src/app/users/user-edit/user-edit.component.ts b/Subiton/src/app/users/user-edit/user-edit.component.ts index a9df2bf..e3db89e 100644 --- a/Subiton/src/app/users/user-edit/user-edit.component.ts +++ b/Subiton/src/app/users/user-edit/user-edit.component.ts @@ -4,6 +4,7 @@ import { ActivatedRoute } from '@angular/router'; import { NgxGalleryImage, NgxGalleryOptions, NgxGalleryAnimation } from 'ngx-gallery'; import { AlertifyService } from 'src/app/_services/alertify.service'; import { NgForm } from '@angular/forms'; +import { UserService } from 'src/app/_services/user.service'; @Component({ selector: 'app-user-edit', @@ -28,7 +29,8 @@ export class UserEditComponent implements OnInit { } constructor(private route: ActivatedRoute, - private alertify: AlertifyService) { } + private alertify: AlertifyService, + private userService: UserService) { } ngOnInit(): void { @@ -91,6 +93,7 @@ export class UserEditComponent implements OnInit { // save chnages - edit profile updateUser() { + this.userService.updateUser(this.user.id, this.user); this.alertify.success('Succesfully saved changes.'); this.editForm.reset(this.user); }