From bf2e6489b7a35ace139d7b60857951a53d45efc8 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Mon, 16 May 2016 22:40:23 -0500 Subject: [PATCH] fix: Provide default type and text for new task creation in score route --- website/server/controllers/api-v2/user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/server/controllers/api-v2/user.js b/website/server/controllers/api-v2/user.js index daaa272491..fcac86e2e1 100644 --- a/website/server/controllers/api-v2/user.js +++ b/website/server/controllers/api-v2/user.js @@ -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 });