Fix inverted create and update calls.

This commit is contained in:
Alexis Lahouze 2017-07-25 17:26:09 +02:00
parent 2f64fa1018
commit fc14efbda1
2 changed files with 2 additions and 2 deletions

View File

@ -105,7 +105,7 @@ export class ScheduleListComponent implements OnInit {
}; };
save(schedule: Schedule) { save(schedule: Schedule) {
return this.scheduleService.update(schedule).subscribe((schedule: Schedule) => { return this.scheduleService.create(schedule).subscribe((schedule: Schedule) => {
this.toastrService.success('Schedule #' + schedule.id + ' saved.'); this.toastrService.success('Schedule #' + schedule.id + ' saved.');
this.load(); this.load();

View File

@ -63,7 +63,7 @@ export class ScheduleRowComponent {
) {} ) {}
save(schedule: Schedule) { save(schedule: Schedule) {
return this.scheduleService.create(schedule).subscribe((schedule: Schedule) => { return this.scheduleService.update(schedule).subscribe((schedule: Schedule) => {
this.toastrService.success('Schedule #' + schedule.id + ' saved.'); this.toastrService.success('Schedule #' + schedule.id + ' saved.');
this.needsReload.emit(); this.needsReload.emit();