mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-24 08:19:48 +01:00
fix: order of operations when updating category handle
This commit is contained in:
@@ -165,9 +165,9 @@ module.exports = function (Categories) {
|
|||||||
throw new Error('[[error:category.handle-taken]]');
|
throw new Error('[[error:category.handle-taken]]');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await db.sortedSetRemove('categoryhandle:cid', existing);
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
db.setObjectField(`category:${cid}`, 'handle', handle),
|
db.setObjectField(`category:${cid}`, 'handle', handle),
|
||||||
db.sortedSetRemove('categoryhandle:cid', existing),
|
|
||||||
db.sortedSetAdd('categoryhandle:cid', cid, handle),
|
db.sortedSetAdd('categoryhandle:cid', cid, handle),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user