Updated login headers save. Added task service to user service. Sync user tasks

This commit is contained in:
Keith Holliday
2016-05-09 23:31:34 -05:00
parent a92359e119
commit a0939155c9
13 changed files with 107 additions and 86 deletions

View File

@@ -5,6 +5,7 @@ import taskDefaults from '../libs/taskDefaults';
module.exports = function addTask (user, req = {body: {}}) {
let task = taskDefaults(req.body);
user.tasksOrder[`${task.type}s`].unshift(task._id);
user[`${task.type}s`].unshift(task);
if (user.preferences.newTaskEdit) {
task._editing = true;