fix: send 404 when no miis are found in search API route

also remove redundant line in README
This commit is contained in:
trafficlunar 2025-11-16 21:27:24 +00:00
parent 196f9d4640
commit 67bd6a4297
2 changed files with 8 additions and 17 deletions

View file

@ -29,19 +29,6 @@ export async function GET(request: NextRequest) {
...(gender && { gender: { equals: gender } }),
};
const select: Prisma.MiiSelect = {
id: true,
name: true,
imageCount: true,
tags: true,
createdAt: true,
gender: true,
// Like count
_count: {
select: { likedBy: true },
},
};
const skip = (page - 1) * limit;
if (sort === "random") {
@ -54,7 +41,7 @@ export async function GET(request: NextRequest) {
select: { id: true },
});
if (matchingIds.length === 0) return;
if (matchingIds.length === 0) return rateLimit.sendResponse({ error: "No Miis found!" }, 404);
const rng = seedrandom(randomSeed.toString());