From 175dc2090654a70add7a7cca401688da93525c63 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 24 Sep 2025 10:42:16 -0400 Subject: [PATCH] fix: #13676, bug where nested remote categories could not be removed --- src/controllers/admin/categories.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/controllers/admin/categories.js b/src/controllers/admin/categories.js index e6bb7aaa41..a74b362765 100644 --- a/src/controllers/admin/categories.js +++ b/src/controllers/admin/categories.js @@ -218,7 +218,9 @@ categoriesController.removeRemote = async function (req, res) { return helpers.formatApiResponse(400, res); } - await db.sortedSetRemove('cid:0:children', req.params.cid); - cache.del('cid:0:children'); + const parentCid = await categories.getCategoryField(req.params.cid, 'parentCid'); + await db.sortedSetRemove(`cid:${parentCid || 0}:children`, req.params.cid); + cache.del(`cid:${parentCid || 0}:children`); + res.sendStatus(200); };