diff options
| author | erik-nilcoast <138068205+erik-nilcoast@users.noreply.github.com> | 2025-03-09 10:18:46 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-09 15:18:46 +0000 |
| commit | 9fb80514773d63115a5b41787b339670326bb763 (patch) | |
| tree | d88c6e8b57336dbec0803974dd1f5b0205cdd4a9 /apps/web/app/api | |
| parent | 80a808048340f7f5e95e71c4ee649fdae7c8c565 (diff) | |
| download | karakeep-9fb80514773d63115a5b41787b339670326bb763.tar.zst | |
feat: Expose bookmark summarization in the API (#1088)
Proxy to the TRPC Summarize mutation for use in the public API
Diffstat (limited to 'apps/web/app/api')
| -rw-r--r-- | apps/web/app/api/v1/bookmarks/[bookmarkId]/summarize/route.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/web/app/api/v1/bookmarks/[bookmarkId]/summarize/route.ts b/apps/web/app/api/v1/bookmarks/[bookmarkId]/summarize/route.ts new file mode 100644 index 00000000..ea41cad4 --- /dev/null +++ b/apps/web/app/api/v1/bookmarks/[bookmarkId]/summarize/route.ts @@ -0,0 +1,19 @@ +import { NextRequest } from "next/server"; +import { buildHandler } from "@/app/api/v1/utils/handler"; + +export const dynamic = "force-dynamic"; + +export const POST = ( + req: NextRequest, + params: { params: { bookmarkId: string } }, +) => + buildHandler({ + req, + handler: async ({ api }) => { + const bookmark = await api.bookmarks.summarizeBookmark({ + bookmarkId: params.params.bookmarkId, + }); + + return { status: 200, resp: bookmark }; + }, + }); |
