aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/app/api/bookmarks/export
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-10-05 14:48:39 +0000
committerMohamedBassem <me@mbassem.com>2024-10-05 17:15:36 +0000
commit1f7da9ae38a6f6304f8ab78271e4331614c450f9 (patch)
tree9efd8ea6b91c910f4a8e1ddff3ab0a7df74f614a /apps/web/app/api/bookmarks/export
parent3f22801a0d06f36db01a2775b7e9bc1b6c72d3e7 (diff)
downloadkarakeep-1f7da9ae38a6f6304f8ab78271e4331614c450f9.tar.zst
fix(web): Change export format to have content as a top level key
Diffstat (limited to 'apps/web/app/api/bookmarks/export')
-rw-r--r--apps/web/app/api/bookmarks/export/route.tsx19
1 files changed, 11 insertions, 8 deletions
diff --git a/apps/web/app/api/bookmarks/export/route.tsx b/apps/web/app/api/bookmarks/export/route.tsx
index 3b12b878..aefa76b5 100644
--- a/apps/web/app/api/bookmarks/export/route.tsx
+++ b/apps/web/app/api/bookmarks/export/route.tsx
@@ -16,14 +16,17 @@ function toExportFormat(bookmark: ZBookmark) {
: null),
tags: bookmark.tags.map((t) => t.name),
type: bookmark.content.type,
- url:
- bookmark.content.type === BookmarkTypes.LINK
- ? bookmark.content.url
- : undefined,
- text:
- bookmark.content.type === BookmarkTypes.TEXT
- ? bookmark.content.text
- : undefined,
+ content: {
+ type: bookmark.content.type,
+ url:
+ bookmark.content.type === BookmarkTypes.LINK
+ ? bookmark.content.url
+ : undefined,
+ text:
+ bookmark.content.type === BookmarkTypes.TEXT
+ ? bookmark.content.text
+ : undefined,
+ },
note: bookmark.note,
};
}