store reminders for tasks

This commit is contained in:
Phillip Thelen
2016-02-18 20:30:02 +01:00
parent c95950c679
commit 86181253c6
2 changed files with 10 additions and 2 deletions

View File

@@ -815,10 +815,13 @@ api.wrap = function(user, main) {
message: i18n.t('messageTaskNotFound', req.language) message: i18n.t('messageTaskNotFound', req.language)
}) : void 0; }) : void 0;
} }
_.merge(task, _.omit(req.body, ['checklist', 'id', 'type'])); _.merge(task, _.omit(req.body, ['checklist', 'remidners', 'id', 'type']));
if (req.body.checklist) { if (req.body.checklist) {
task.checklist = req.body.checklist; task.checklist = req.body.checklist;
} }
if (req.body.reminders) {
task.reminders = req.body.reminders;
}
if (typeof task.markModified === "function") { if (typeof task.markModified === "function") {
task.markModified('tags'); task.markModified('tags');
} }

View File

@@ -28,7 +28,12 @@ var TaskSchema = {
broken: String, // CHALLENGE_DELETED, TASK_DELETED, UNSUBSCRIBED, CHALLENGE_CLOSED broken: String, // CHALLENGE_DELETED, TASK_DELETED, UNSUBSCRIBED, CHALLENGE_CLOSED
winner: String // user.profile.name winner: String // user.profile.name
// group: {type: 'Strign', ref: 'Group'} // if we restore this, rename `id` above to `challenge` // 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( var HabitSchema = new Schema(