feat: port mii list to use api route

also make search bar redirect to index page with search param instead of
a new page
This commit is contained in:
trafficlunar 2025-04-12 23:13:34 +01:00
parent 90eca1bf3f
commit 53a23f35ef
7 changed files with 116 additions and 166 deletions

View file

@ -9,6 +9,15 @@ export const nameSchema = z
message: "Name can only contain letters, numbers, dashes, underscores, apostrophes, and spaces.",
});
export const querySchema = z
.string()
.trim()
.min(2, { message: "Search query must be at least 2 characters long" })
.max(64, { message: "Search query cannot be more than 64 characters long" })
.regex(/^[a-zA-Z0-9-_. ']+$/, {
message: "Search query can only contain letters, numbers, dashes, underscores, apostrophes, and spaces.",
});
export const tagsSchema = z
.array(
z