mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-06-17 04:54:47 +00:00
fix: send 404 when no miis are found in search API route
also remove redundant line in README
This commit is contained in:
parent
196f9d4640
commit
67bd6a4297
2 changed files with 8 additions and 17 deletions
|
|
@ -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());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue