mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 10:06:13 +01:00
remove more parseInts
This commit is contained in:
@@ -262,9 +262,7 @@ function getCategoryData(cids, uid, selectedCid, callback) {
|
||||
categories.getCategoriesFields(cids, ['cid', 'name', 'slug', 'icon', 'link', 'color', 'bgColor', 'parentCid', 'image', 'imageClass'], next);
|
||||
},
|
||||
function (categoryData, next) {
|
||||
categoryData = categoryData.filter(function (category) {
|
||||
return category && !category.link;
|
||||
});
|
||||
categoryData = categoryData.filter(category => category && !category.link);
|
||||
var selectedCategory = [];
|
||||
var selectedCids = [];
|
||||
categoryData.forEach(function (category) {
|
||||
@@ -272,12 +270,10 @@ function getCategoryData(cids, uid, selectedCid, callback) {
|
||||
category.parentCid = category.hasOwnProperty('parentCid') && utils.isNumber(category.parentCid) ? category.parentCid : 0;
|
||||
if (category.selected) {
|
||||
selectedCategory.push(category);
|
||||
selectedCids.push(parseInt(category.cid, 10));
|
||||
selectedCids.push(category.cid);
|
||||
}
|
||||
});
|
||||
selectedCids.sort(function (a, b) {
|
||||
return a - b;
|
||||
});
|
||||
selectedCids.sort((a, b) => a - b);
|
||||
|
||||
if (selectedCategory.length > 1) {
|
||||
selectedCategory = {
|
||||
|
||||
Reference in New Issue
Block a user