feat: show miis on profiles

and other changes
This commit is contained in:
trafficlunar 2026-04-17 19:50:47 +01:00
parent 9795849830
commit 896dc40553
17 changed files with 271 additions and 408 deletions

View file

@ -9,7 +9,7 @@ export async function GET(request: NextRequest) {
const parsed = searchSchema.safeParse(Object.fromEntries(request.nextUrl.searchParams));
if (!parsed.success) return NextResponse.json({ error: parsed.error.issues[0].message }, { status: 400 });
const { q: query, sort, tags, exclude, platform, gender, makeup, allowCopying, quarantined, page = 1, limit = 24, seed, parentPage, userId } = parsed.data;
const { q: query, sort, tags, exclude, platform, gender, makeup, allowCopying, quarantined, page = 1, limit = 24, parentPage, userId } = parsed.data;
// My Likes page
let miiIdsLiked: number[] | undefined = undefined;
@ -107,7 +107,7 @@ export async function GET(request: NextRequest) {
}
[totalCount, miis] = await Promise.all([
prisma.mii.count({ where: { ...where } }), // TODO: User id
prisma.mii.count({ where: { ...where, userId } }),
prisma.mii.findMany({
where,
orderBy,