Skip to content

Commit

Permalink
Update user-edit.component.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Oktawian-L committed Nov 3, 2019
1 parent cc1aa4d commit 712de89
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Subiton/src/app/users/user-edit/user-edit.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -28,7 +29,8 @@ export class UserEditComponent implements OnInit {
}

constructor(private route: ActivatedRoute,
private alertify: AlertifyService) { }
private alertify: AlertifyService,
private userService: UserService) { }

ngOnInit(): void {

Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 712de89

Please sign in to comment.