From 263374985be7ed476913238b0800b02e93c6d23b Mon Sep 17 00:00:00 2001 From: konrad Date: Wed, 5 Jun 2019 19:36:32 +0200 Subject: [PATCH] Fixed task update not working --- src/services/abstractService.js | 4 ++-- src/services/task.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/services/abstractService.js b/src/services/abstractService.js index 323fd5e0..f6f6454e 100644 --- a/src/services/abstractService.js +++ b/src/services/abstractService.js @@ -207,9 +207,9 @@ export default class AbstractService { * @param model * @return {*} */ -/* beforeUpdate(model) { + beforeUpdate(model) { return model - }*/ + } /** * Default preprocessor for delete requests diff --git a/src/services/task.js b/src/services/task.js index f3e0c1fd..9b99cd07 100644 --- a/src/services/task.js +++ b/src/services/task.js @@ -28,9 +28,9 @@ export default class TaskService extends AbstractService { model.listID = Number(model.listID) // Convert the date in a unix timestamp - model.dueDate = Math.round(+new Date(model.dueDate) / 1000) - model.startDate = Math.round(+new Date(model.startDate) / 1000) - model.endDate = Math.round(+new Date(model.endDate) / 1000) + model.dueDate = model.dueDate !== null ? Math.round(+new Date(model.dueDate) / 1000) : model.dueDate + model.startDate = model.startDate !== null ? Math.round(+new Date(model.startDate) / 1000): model.startDate + model.endDate = model.endDate !== null ? Math.round(+new Date(model.endDate) / 1000) : model.endDate // remove all nulls, these would create empty reminders for (const index in model.reminderDates) {