From 84637ad336eecb4e74ad245438c820270d6d7bc3 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Tue, 7 Jan 2014 17:23:22 -0700 Subject: [PATCH] fix https://github.com/HabitRPG/habitrpg/issues/2276 provide newly-created tags with an id from the browser --- dist/habitrpg-shared.js | 5 ++--- script/index.coffee | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index e25dc762fe..54aaefb4b7 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -11601,13 +11601,12 @@ var process=require("__browserify_process");(function() { return task; }, addTag: function(req, cb) { - var name; - name = req.body.name; if (user.tags == null) { user.tags = []; } user.tags.push({ - name: name + name: req.body.name, + id: req.body.id || api.uuid() }); return typeof cb === "function" ? cb(null, user.tags) : void 0; }, diff --git a/script/index.coffee b/script/index.coffee index c9deddf5e6..50a9f98b14 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -505,9 +505,10 @@ api.wrap = (user, main=true) -> # ------ addTag: (req, cb) -> - {name} = req.body user.tags ?= [] - user.tags.push({name}) + user.tags.push + name: req.body.name + id: req.body.id or api.uuid() cb? null, user.tags updateTag: (req, cb) ->