remove some more parseInts

This commit is contained in:
Barış Soner Uşaklı
2018-10-22 21:58:34 -04:00
parent 7a44424214
commit c738dc7d3e
9 changed files with 54 additions and 59 deletions

View File

@@ -97,7 +97,6 @@ module.exports = function (Categories) {
function (oldParent, next) {
async.series([
function (next) {
oldParent = parseInt(oldParent, 10) || 0;
db.sortedSetRemove('cid:' + oldParent + ':children', cid, next);
},
function (next) {
@@ -125,9 +124,7 @@ module.exports = function (Categories) {
db.delete('cid:' + cid + ':tag:whitelist', next);
},
function (next) {
var scores = tags.map(function (tag, index) {
return index;
});
var scores = tags.map((tag, index) => index);
db.sortedSetAdd('cid:' + cid + ':tag:whitelist', scores, tags, next);
},
], callback);
@@ -144,7 +141,6 @@ module.exports = function (Categories) {
db.sortedSetAdd('categories:cid', order, cid, next);
},
function (next) {
parentCid = parseInt(parentCid, 10) || 0;
db.sortedSetAdd('cid:' + parentCid + ':children', order, cid, next);
},
], next);