fix: delete left over nav items after removal of some

isekai-main
Barış Soner Uşaklı 3 years ago
parent 10e890e41f
commit 737e1c191e

@ -26,7 +26,8 @@ admin.save = async function (data) {
cache = null; cache = null;
pubsub.publish('admin:navigation:save'); pubsub.publish('admin:navigation:save');
await db.deleteAll(data.map(item => `navigation:enabled:${item.order}`)); const ids = await db.getSortedSetRange('navigation:enabled', 0, -1);
await db.deleteAll(ids.map(id => `navigation:enabled:${id}`));
await db.setObjectBulk(bulkSet); await db.setObjectBulk(bulkSet);
await db.delete('navigation:enabled'); await db.delete('navigation:enabled');
await db.sortedSetAdd('navigation:enabled', order, order); await db.sortedSetAdd('navigation:enabled', order, order);

Loading…
Cancel
Save