displaying all tags for logged in users, not applying nsfp list

This commit is contained in:
x
2025-05-01 14:59:28 +02:00
parent 4260a7429a
commit 0c96c258ab
2 changed files with 24 additions and 4 deletions

View File

@@ -1,7 +1,5 @@
import db from "../../inc/sql.mjs";
import cfg from "../../inc/config.mjs";
import lib from "../../inc/lib.mjs";
import f0cklib from "../routeinc/f0cklib.mjs";
export default (router, tpl) => {
router.get(/^\/tags$/, async (req, res) => {
@@ -20,9 +18,21 @@ export default (router, tpl) => {
LIMIT 500
;
`;
const toptags_regged = await db`
SELECT t.id, t.tag, COUNT(DISTINCT ta.item_id) AS total_items
FROM tags t
LEFT JOIN tags_assign ta ON t.id = ta.tag_id
GROUP BY t.id, t.tag
ORDER BY total_items DESC
LIMIT 500
;
`;
res.reply({
body: tpl.render('tags', {
toptags,
toptags_regged,
phrase,
tmp: null
}, req)