Added support for grouping tasks by chllenge

This commit is contained in:
Keith Holliday
2017-02-02 13:19:30 -07:00
committed by Alys
parent aef71db0f5
commit c244fe488d
8 changed files with 29 additions and 6 deletions

View File

@@ -121,7 +121,7 @@ schema.methods.syncToUser = async function syncChallengeToUser (user) {
if (!matchingTask) { // If the task is new, create it
matchingTask = new Tasks[chalTask.type](Tasks.Task.sanitize(syncableAttrs(chalTask)));
matchingTask.challenge = {taskId: chalTask._id, id: challenge._id};
matchingTask.challenge = {taskId: chalTask._id, id: challenge._id, name: challenge.shortName};
matchingTask.userId = user._id;
user.tasksOrder[`${chalTask.type}s`].push(matchingTask._id);
} else {