diff options
| author | MohamedBassem <me@mbassem.com> | 2024-02-09 16:47:17 +0000 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-02-09 16:51:24 +0000 |
| commit | 7400914396eea0c9a1fb7bc59e022babc2186f42 (patch) | |
| tree | 36e4a3d05b43d15254d75fddebc0594747b70a91 /packages/web/lib/api.ts | |
| parent | 5c0fd0143e5ded1d8e957ec5e59e21d7c629d036 (diff) | |
| download | karakeep-7400914396eea0c9a1fb7bc59e022babc2186f42.tar.zst | |
[feature] Add the ability to favourite and archive bookmarks
Diffstat (limited to 'packages/web/lib/api.ts')
| -rw-r--r-- | packages/web/lib/api.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/web/lib/api.ts b/packages/web/lib/api.ts index f7942310..3978dcb6 100644 --- a/packages/web/lib/api.ts +++ b/packages/web/lib/api.ts @@ -3,6 +3,8 @@ import { ZodTypeAny, z } from "zod"; import { ZNewBookmarkRequest, + ZUpdateBookmarksRequest, + zBookmarkSchema, zGetBookmarksResponseSchema, } from "./types/api/bookmarks"; @@ -79,4 +81,11 @@ export default class APIClient { method: "DELETE", }); } + + static async updateBookmark(id: string, update: ZUpdateBookmarksRequest) { + return await doRequest(`/bookmarks/${id}`, zBookmarkSchema, { + method: "PATCH", + body: JSON.stringify(update), + }); + } } |
