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,