From 1f5d5668b7558ec4d0a77129041cba3ba6d72cb7 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sun, 5 Jan 2025 12:01:42 +0000 Subject: feat: Expose the search functionality in the REST API --- packages/open-api/lib/bookmarks.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'packages/open-api/lib') diff --git a/packages/open-api/lib/bookmarks.ts b/packages/open-api/lib/bookmarks.ts index 09288a4b..c7c05256 100644 --- a/packages/open-api/lib/bookmarks.ts +++ b/packages/open-api/lib/bookmarks.ts @@ -73,6 +73,32 @@ registry.registerPath({ }, }); +registry.registerPath({ + method: "get", + path: "/bookmarks/search", + description: "Search bookmarks", + summary: "Search bookmarks", + tags: ["Bookmarks"], + security: [{ [BearerAuth.name]: [] }], + request: { + query: z + .object({ + q: z.string(), + }) + .merge(PaginationSchema), + }, + responses: { + 200: { + description: "Object with the search results.", + content: { + "application/json": { + schema: PaginatedBookmarksSchema, + }, + }, + }, + }, +}); + registry.registerPath({ method: "post", path: "/bookmarks", -- cgit v1.2.3-70-g09d2