diff --git a/src/scheduler/schedule.controller.ts b/src/scheduler/schedule.controller.ts index 37e19a2..ffdafd2 100644 --- a/src/scheduler/schedule.controller.ts +++ b/src/scheduler/schedule.controller.ts @@ -17,6 +17,7 @@ export class ScheduleController{ private $stateParams, private toastrService: ToastrService, private scheduleService: ScheduleService, + private logger: Logger, private $modal ) { // Load operations on controller initialization. @@ -51,9 +52,11 @@ export class ScheduleController{ let subscription: Observable; if(operation.id) { - subscription = this.scheduleService.create(operation); - } else { + this.logger.log("updating schedule", operation); subscription = this.scheduleService.update(operation); + } else { + this.logger.log("creating schedule", operation); + subscription = this.scheduleService.create(operation); } return subscription.subscribe((operation: Schedule) => { diff --git a/src/scheduler/schedule.service.ts b/src/scheduler/schedule.service.ts index fb0d8f1..d29036b 100644 --- a/src/scheduler/schedule.service.ts +++ b/src/scheduler/schedule.service.ts @@ -44,6 +44,6 @@ export class ScheduleService { } delete(schedule: Schedule): Observable { - return this.one(schedule.id).delete(); + return this.one(schedule.id).remove(); } }