diff options
Diffstat (limited to 'packages/open-api/lib/lists.ts')
| -rw-r--r-- | packages/open-api/lib/lists.ts | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/packages/open-api/lib/lists.ts b/packages/open-api/lib/lists.ts index 2273d33b..992b96c4 100644 --- a/packages/open-api/lib/lists.ts +++ b/packages/open-api/lib/lists.ts @@ -4,6 +4,7 @@ import { } from "@asteasolutions/zod-to-openapi"; import { z } from "zod"; +import { zSortOrder } from "@karakeep/shared/types/bookmarks"; import { zBookmarkListSchema, zEditBookmarkListSchema, @@ -190,13 +191,21 @@ registry.registerPath({ registry.registerPath({ method: "get", path: "/lists/{listId}/bookmarks", - description: "Get the bookmarks in a list", - summary: "Get a bookmarks in a list", + description: "Get bookmarks in the list", + summary: "Get bookmarks in the list", tags: ["Lists"], security: [{ [BearerAuth.name]: [] }], request: { params: z.object({ listId: ListIdSchema }), - query: PaginationSchema.merge(IncludeContentSearchParamSchema), + query: z + .object({ + sortOrder: zSortOrder + .exclude(["relevance"]) + .optional() + .default(zSortOrder.Enum.desc), + }) + .merge(PaginationSchema) + .merge(IncludeContentSearchParamSchema), }, responses: { 200: { @@ -232,14 +241,6 @@ registry.registerPath({ 204: { description: "No content - the bookmark was added", }, - 400: { - description: "Bookmark already in list", - content: { - "application/json": { - schema: ErrorSchema, - }, - }, - }, 404: { description: "List or bookmark not found", content: { |
