newly-created tags with an id from the browser
This commit is contained in:
Tyler Renelle 2014-01-07 17:23:22 -07:00
parent 398a919afb
commit 84637ad336
2 changed files with 5 additions and 5 deletions

View file

@ -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;
},

View file

@ -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) ->