This commit is contained in:
Matteo Pagliazzi
2015-12-02 11:30:58 +01:00
parent 427c805ea5
commit 62708d4365
3 changed files with 3 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@@ -196,8 +196,6 @@ api.scoreTask = {
}).exec() }).exec()
.then((task) => { .then((task) => {
if (!task) throw new NotFound(res.t('taskNotFound')); if (!task) throw new NotFound(res.t('taskNotFound'));
let delta = user.ops.score({params:{id:task.id, direction:direction}, language: req.language});
}) })
.then(() => res.respond(200, {})) // TODO what to return .then(() => res.respond(200, {})) // TODO what to return
.catch(next); .catch(next);

View File

@@ -509,11 +509,11 @@ function _populateDefaultTasks (user, taskTypes) {
if (tagsI !== -1) { if (tagsI !== -1) {
taskTypes = _.clone(taskTypes); taskTypes = _.clone(taskTypes);
taskTypes.splice(tagsI, 1); taskTypes.splice(tagsI, 1);
}; }
_.each(taskTypes, (taskType) => { _.each(taskTypes, (taskType) => {
let tasksOfType = _.map(shared.content.userDefaults[`${taskType}s`], (taskDefaults) => { let tasksOfType = _.map(shared.content.userDefaults[`${taskType}s`], (taskDefaults) => {
let newTask = new (Tasks[taskType])(taskDefaults); let newTask = new Tasks[taskType](taskDefaults);
newTask.userId = user._id; newTask.userId = user._id;
newTask.text = taskDefaults.text(user.preferences.language); newTask.text = taskDefaults.text(user.preferences.language);