aboutsummaryrefslogtreecommitdiffstats
path: root/web/lib/services/links.ts
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-02-07 18:12:53 +0000
committerMohamedBassem <me@mbassem.com>2024-02-07 18:12:53 +0000
commit3745443c2b27afb833be7bcc2f3b4f486a42a571 (patch)
tree88f0a90fb100b56ad9e9f4686a1f72c50ba7d5a9 /web/lib/services/links.ts
parent293869e1743c925519d938ebeeff033c773a1ec6 (diff)
downloadkarakeep-3745443c2b27afb833be7bcc2f3b4f486a42a571.tar.zst
[feature] Add support for deleting links
Diffstat (limited to 'web/lib/services/links.ts')
-rw-r--r--web/lib/services/links.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/web/lib/services/links.ts b/web/lib/services/links.ts
index f3ff1757..dbcbe9c4 100644
--- a/web/lib/services/links.ts
+++ b/web/lib/services/links.ts
@@ -1,6 +1,15 @@
import { LinkCrawlerQueue } from "@remember/shared/queues";
import prisma from "@remember/db";
+export async function unbookmarkLink(linkId: string, userId: string) {
+ await prisma.bookmarkedLink.delete({
+ where: {
+ id: linkId,
+ userId,
+ },
+ });
+}
+
export async function bookmarkLink(url: string, userId: string) {
const link = await prisma.bookmarkedLink.create({
data: {