aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web')
-rw-r--r--apps/web/app/api/v1/bookmarks/search/route.ts28
1 files changed, 16 insertions, 12 deletions
diff --git a/apps/web/app/api/v1/bookmarks/search/route.ts b/apps/web/app/api/v1/bookmarks/search/route.ts
index f0c5417a..52081c7f 100644
--- a/apps/web/app/api/v1/bookmarks/search/route.ts
+++ b/apps/web/app/api/v1/bookmarks/search/route.ts
@@ -2,29 +2,33 @@ import { NextRequest } from "next/server";
import { z } from "zod";
import { buildHandler } from "../../utils/handler";
+import { zGetBookmarkSearchParamsSchema } from "../../utils/types";
export const dynamic = "force-dynamic";
export const GET = (req: NextRequest) =>
buildHandler({
req,
- searchParamsSchema: z.object({
- q: z.string(),
- limit: z.coerce.number().optional(),
- cursor: z
- .string()
- // Search cursor V1 is just a number
- .pipe(z.coerce.number())
- .transform((val) => {
- return { ver: 1 as const, offset: val };
- })
- .optional(),
- }),
+ searchParamsSchema: z
+ .object({
+ q: z.string(),
+ limit: z.coerce.number().optional(),
+ cursor: z
+ .string()
+ // Search cursor V1 is just a number
+ .pipe(z.coerce.number())
+ .transform((val) => {
+ return { ver: 1 as const, offset: val };
+ })
+ .optional(),
+ })
+ .and(zGetBookmarkSearchParamsSchema),
handler: async ({ api, searchParams }) => {
const bookmarks = await api.bookmarks.searchBookmarks({
text: searchParams.q,
cursor: searchParams.cursor,
limit: searchParams.limit,
+ includeContent: searchParams.includeContent,
});
return {
status: 200,