tagpage: fix pagination

This commit is contained in:
Flummi 2022-03-25 16:03:33 +01:00
parent e15c16434c
commit d43195b52d

View File

@ -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,