add unlinkTask route and refactor user.unlink (now user.unlinkChallengesTasks)

This commit is contained in:
Matteo Pagliazzi
2016-01-14 19:46:43 +01:00
parent 01458574f9
commit 5206469e90
5 changed files with 95 additions and 54 deletions
+1 -1
View File
@@ -182,7 +182,7 @@ schema.methods.removeTask = async function challengeRemoveTask (task) {
'challenge.taskId': task._id,
}, {
$set: {'challenge.broken': 'TASK_DELETED'}, // TODO what about updatedAt?
}).lean().exec();
}, {multi: true}).exec();
};
export let model = mongoose.model('Challenge', schema);