Added note sync when user adds task to challenge, tests, and fixed challenge tests (#8200)

This commit is contained in:
Keith Holliday
2016-11-12 16:48:22 -06:00
committed by Matteo Pagliazzi
parent 13df60e0dd
commit cbe1892b50
3 changed files with 52 additions and 26 deletions

View File

@@ -157,6 +157,7 @@ async function _addTaskFn (challenge, tasks, memberId) {
let userTask = new Tasks[chalTask.type](Tasks.Task.sanitize(syncableAttrs(chalTask)));
userTask.challenge = {taskId: chalTask._id, id: challenge._id};
userTask.userId = memberId;
userTask.notes = chalTask.notes; // We want to sync the notes when the task is first added to the challenge
let tasksOrderList = updateTasksOrderQ.$push[`tasksOrder.${chalTask.type}s`];
if (!tasksOrderList) {