From d43195b52d6e7b909e816a2fcc36e565fdd6415f Mon Sep 17 00:00:00 2001 From: Flummi Date: Fri, 25 Mar 2022 16:03:33 +0100 Subject: [PATCH] tagpage: fix pagination --- src/inc/routes/inc/f0cklib.mjs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/inc/routes/inc/f0cklib.mjs b/src/inc/routes/inc/f0cklib.mjs index 18f5de1..d921b84 100644 --- a/src/inc/routes/inc/f0cklib.mjs +++ b/src/inc/routes/inc/f0cklib.mjs @@ -27,7 +27,6 @@ export default { }; total = (await sql("items") - .select("items.id", "items.mime", "st.tag") .innerJoin( sql("tags") .select("tags_assign.item_id", "tags.tag") @@ -38,9 +37,9 @@ export default { "st.item_id", "items.id" ) .whereRaw(modequery) - .groupBy('items.id', 'st.tag', 'st.item_id') + .groupBy('st.tag', 'st.item_id') .count("* as total") - )[0]?.total; + )?.length; } else { if(!o.fav) { @@ -120,12 +119,9 @@ export default { ) .groupBy('st.item_id', 'items.id', 'tags_assign.tag_id'); } - rows = await rows; - - - + if(rows.length === 0) return { success: false,