diff options
Diffstat (limited to 'web/lib/api.ts')
| -rw-r--r-- | web/lib/api.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/web/lib/api.ts b/web/lib/api.ts index 193d9bb7..12ce9464 100644 --- a/web/lib/api.ts +++ b/web/lib/api.ts @@ -35,8 +35,8 @@ async function doRequest<T>( opts?: RequestInit, ): Promise< | (InputSchema<T> extends ZodTypeAny - ? [z.infer<InputSchema<T>>, undefined] - : [undefined, undefined]) + ? [z.infer<InputSchema<T>>, undefined] + : [undefined, undefined]) | [undefined, FetchError] > { try { @@ -84,4 +84,10 @@ export default class APIClient { body: JSON.stringify(body), }); } + + static async unbookmarkLink(linkId: string) { + return await doRequest(`/links/${linkId}`, undefined, { + method: "DELETE", + }); + } } |
