From d781290430e0042108cbad0aa44b2cda6af04344 Mon Sep 17 00:00:00 2001 From: Flummi Date: Sun, 2 Jan 2022 14:29:26 +0100 Subject: [PATCH] issue #5 --- src/inc/routes/apiv2.mjs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/inc/routes/apiv2.mjs b/src/inc/routes/apiv2.mjs index 27bfaa4..d1add41 100644 --- a/src/inc/routes/apiv2.mjs +++ b/src/inc/routes/apiv2.mjs @@ -163,6 +163,12 @@ export default (router, tpl) => { q = q.andWhere("user_id", req.session.id); const reply = !!(await q); + await sql('tags') // delete not used tags + .whereNotIn('id', sql('tags_assign').select('tag_id')) + .andWhereNot('tag', 'sfw') + .andWhereNot('tag', 'nsfw') + .del(); + return res.reply({ body: JSON.stringify({ success: reply, tagid: tagid,