mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-06-28 14:44:15 +00:00
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:
parent
90eca1bf3f
commit
53a23f35ef
7 changed files with 116 additions and 166 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue