shared-code-user-score-task

This commit is contained in:
Victor Piousbox
2016-04-01 15:54:47 +00:00
parent 3089658cc7
commit e6e2c26a12
6 changed files with 226 additions and 9 deletions

View File

@@ -54,6 +54,13 @@ export async function generateReward (update = {}) {
return task;
}
export async function generateTodo (update = {}) {
let type = 'todo';
let task = new Tasks[type](update);
await task.save({ validateBeforeSave: false });
return task;
}
// Generates a new group. Requires a user object, which
// will will become the groups leader. Takes a details argument
// for the initial group creation and an update argument which