Moved approval fields to group subdoc

This commit is contained in:
Keith Holliday
2016-10-22 13:07:26 -05:00
parent d798ebadfe
commit 3ec3722038
7 changed files with 26 additions and 21 deletions

View File

@@ -51,6 +51,10 @@ export async function createTasks (req, res, options = {}) {
let taskType = taskData.type;
let newTask = new Tasks[taskType](Tasks.Task.sanitize(taskData));
if (taskData.requiresApproval) {
newTask.group.requiresApproval = true;
}
if (challenge) {
newTask.challenge.id = challenge.id;
} else if (group) {