fix zsets and update them on post move, closes #6823 (#6827)

This commit is contained in:
Barış Soner Uşaklı
2018-10-11 16:00:22 -04:00
committed by GitHub
parent 762dac6a4a
commit 5c7dd54815
9 changed files with 304 additions and 79 deletions

View File

@@ -28,9 +28,15 @@ module.exports = function (Categories) {
return;
}
category.name = validator.escape(String(category.name || ''));
category.disabled = category.hasOwnProperty('disabled') ? parseInt(category.disabled, 10) === 1 : undefined;
category.isSection = category.hasOwnProperty('isSection') ? parseInt(category.isSection, 10) === 1 : undefined;
if (category.hasOwnProperty('name')) {
category.name = validator.escape(String(category.name || ''));
}
if (category.hasOwnProperty('disabled')) {
category.disabled = parseInt(category.disabled, 10) === 1;
}
if (category.hasOwnProperty('isSection')) {
category.isSection = parseInt(category.isSection, 10) === 1;
}
if (category.hasOwnProperty('icon')) {
category.icon = category.icon || 'hidden';