mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-10 17:42:52 +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]]');
|
||||
}
|
||||
|
||||
await db.sortedSetRemove('categoryhandle:cid', existing);
|
||||
await Promise.all([
|
||||
db.setObjectField(`category:${cid}`, 'handle', handle),
|
||||
db.sortedSetRemove('categoryhandle:cid', existing),
|
||||
db.sortedSetAdd('categoryhandle:cid', cid, handle),
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user