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

@ -4,10 +4,10 @@ import { z } from "zod";
import { auth } from "@/lib/auth";
import { prisma } from "@/lib/prisma";
import { nameSchema } from "@/lib/schemas";
import { querySchema } from "@/lib/schemas";
const searchSchema = z.object({
query: nameSchema.optional(),
q: querySchema.optional(),
sort: z.enum(["newest", "likes"], { message: "Sort must be either 'newest' or 'likes'" }).default("newest"),
tags: z
.string()