Enhance tags

This commit is contained in:
2025-12-21 01:06:27 +01:00
parent e90578c98a
commit 6fc641306a
20 changed files with 687 additions and 111 deletions

View File

@ -9,7 +9,7 @@ export type ArtworkListParams = {
};
export async function getArtworksPage(params: ArtworkListParams) {
const { published = "all", take = 48, cursor } = params;
const { published = "all", cursor, take = 48 } = params;
const where: Prisma.ArtworkWhereInput = {};
@ -21,8 +21,13 @@ export async function getArtworksPage(params: ArtworkListParams) {
where,
include: {
file: true,
variants: true,
gallery: true,
metadata: true,
albums: true,
categories: true,
colors: true,
tags: true,
variants: true,
},
orderBy: [{ createdAt: "desc" }, { id: "asc" }],
take: take + 1, // fetch one extra to know if there is a next page