From 86181253c6f5338a56ad4628d39cfc7daef4e567 Mon Sep 17 00:00:00 2001 From: Phillip Thelen Date: Thu, 18 Feb 2016 20:30:02 +0100 Subject: [PATCH] store reminders for tasks --- common/script/index.js | 5 ++++- website/src/models/task.js | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/common/script/index.js b/common/script/index.js index dd5d2bf2f5..996cfabde1 100644 --- a/common/script/index.js +++ b/common/script/index.js @@ -815,10 +815,13 @@ api.wrap = function(user, main) { message: i18n.t('messageTaskNotFound', req.language) }) : void 0; } - _.merge(task, _.omit(req.body, ['checklist', 'id', 'type'])); + _.merge(task, _.omit(req.body, ['checklist', 'remidners', 'id', 'type'])); if (req.body.checklist) { task.checklist = req.body.checklist; } + if (req.body.reminders) { + task.reminders = req.body.reminders; + } if (typeof task.markModified === "function") { task.markModified('tags'); } diff --git a/website/src/models/task.js b/website/src/models/task.js index 8ae24e353a..97a0e1e7c6 100644 --- a/website/src/models/task.js +++ b/website/src/models/task.js @@ -28,7 +28,12 @@ var TaskSchema = { broken: String, // CHALLENGE_DELETED, TASK_DELETED, UNSUBSCRIBED, CHALLENGE_CLOSED winner: String // user.profile.name // group: {type: 'Strign', ref: 'Group'} // if we restore this, rename `id` above to `challenge` - } + }, + reminders: [{ + id: {type:String,'default':shared.uuid}, + startDate: Date, + time: Date + }] }; var HabitSchema = new Schema(