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) {