remove more parseInts

v1.18.x
Barış Soner Uşaklı 6 years ago
parent 537b7ff7e8
commit 728e7bdae9

@ -188,11 +188,6 @@ function ignoreOrWatch(fn, socket, cid, callback) {
categories.getCategoriesFields(cids, ['cid', 'parentCid'], next); categories.getCategoriesFields(cids, ['cid', 'parentCid'], next);
}, },
function (categoryData, next) { function (categoryData, next) {
categoryData.forEach(function (c) {
c.cid = parseInt(c.cid, 10);
c.parentCid = parseInt(c.parentCid, 10);
});
// filter to subcategories of cid // filter to subcategories of cid
var cat; var cat;
do { do {

@ -246,7 +246,7 @@ module.exports = function (Topics) {
topicTools.move = function (tid, data, callback) { topicTools.move = function (tid, data, callback) {
var topic; var topic;
var oldCid; var oldCid;
var cid = data.cid; var cid = parseInt(data.cid, 10);
async.waterfall([ async.waterfall([
function (next) { function (next) {
@ -257,7 +257,7 @@ module.exports = function (Topics) {
if (!topic) { if (!topic) {
return next(new Error('[[error:no-topic]]')); return next(new Error('[[error:no-topic]]'));
} }
if (parseInt(cid, 10) === parseInt(topic.cid, 10)) { if (cid === topic.cid) {
return next(new Error('[[error:cant-move-topic-to-same-category]]')); return next(new Error('[[error:cant-move-topic-to-same-category]]'));
} }
db.sortedSetsRemove([ db.sortedSetsRemove([
@ -277,7 +277,7 @@ module.exports = function (Topics) {
db.sortedSetAdd('cid:' + cid + ':uid:' + topic.uid + ':tids', topic.timestamp, tid, next); db.sortedSetAdd('cid:' + cid + ':uid:' + topic.uid + ':tids', topic.timestamp, tid, next);
}, },
function (next) { function (next) {
if (parseInt(topic.pinned, 10)) { if (topic.pinned) {
db.sortedSetAdd('cid:' + cid + ':tids:pinned', Date.now(), tid, next); db.sortedSetAdd('cid:' + cid + ':tids:pinned', Date.now(), tid, next);
} else { } else {
async.parallel([ async.parallel([

Loading…
Cancel
Save