mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-20 02:34:12 +00:00
fix https://github.com/HabitRPG/habitrpg/issues/2276 provide
newly-created tags with an id from the browser
This commit is contained in:
parent
398a919afb
commit
84637ad336
2 changed files with 5 additions and 5 deletions
5
dist/habitrpg-shared.js
vendored
5
dist/habitrpg-shared.js
vendored
|
|
@ -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;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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) ->
|
||||
|
|
|
|||
Loading…
Reference in a new issue