fix: Provide default type and text for new task creation in score route

This commit is contained in:
Blade Barringer
2016-05-16 22:40:23 -05:00
parent 7ac67315e6
commit bf2e6489b7

View File

@@ -110,8 +110,8 @@ api.score = function(req, res, next) {
// Defaults. Other defaults are handled in user.ops.addTask()
task = new Tasks.Task({
_id: id, // TODO this might easily lead to conflicts as ids are now unique db-wide
type: body.type,
text: body.text,
type: body.type || 'habit',
text: body.text || id,
userId: user._id,
notes: body.notes || "This task was created by a third-party service. Feel free to edit, it won't harm the connection to that service. Additionally, multiple services may piggy-back off this task." // TODO translate
});