mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 18:56:15 +01:00
fix: #9973, ignore if assigning to same parent
This commit is contained in:
@@ -71,6 +71,9 @@ module.exports = function (Categories) {
|
||||
}
|
||||
const categoryData = await Categories.getCategoryFields(cid, ['parentCid', 'order']);
|
||||
const oldParent = categoryData.parentCid;
|
||||
if (oldParent === newParent) {
|
||||
return;
|
||||
}
|
||||
await Promise.all([
|
||||
db.sortedSetRemove(`cid:${oldParent}:children`, cid),
|
||||
db.sortedSetAdd(`cid:${newParent}:children`, categoryData.order, cid),
|
||||
|
||||
Reference in New Issue
Block a user