From fc14efbda1b043324f8e65e9355cff03dd9b64fd Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Tue, 25 Jul 2017 17:26:09 +0200 Subject: [PATCH] Fix inverted create and update calls. --- src/scheduler/scheduleList.component.ts | 2 +- src/scheduler/scheduleRow.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scheduler/scheduleList.component.ts b/src/scheduler/scheduleList.component.ts index db6f1b0..23dc281 100644 --- a/src/scheduler/scheduleList.component.ts +++ b/src/scheduler/scheduleList.component.ts @@ -105,7 +105,7 @@ export class ScheduleListComponent implements OnInit { }; 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.load(); diff --git a/src/scheduler/scheduleRow.component.ts b/src/scheduler/scheduleRow.component.ts index 020ade3..9fd4809 100644 --- a/src/scheduler/scheduleRow.component.ts +++ b/src/scheduler/scheduleRow.component.ts @@ -63,7 +63,7 @@ export class ScheduleRowComponent { ) {} 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.needsReload.emit();