aboutsummaryrefslogtreecommitdiff
path: root/front-end/src/store/bookmarks.ts
diff options
context:
space:
mode:
Diffstat (limited to 'front-end/src/store/bookmarks.ts')
-rw-r--r--front-end/src/store/bookmarks.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/front-end/src/store/bookmarks.ts b/front-end/src/store/bookmarks.ts
index b6430f7..b0595e9 100644
--- a/front-end/src/store/bookmarks.ts
+++ b/front-end/src/store/bookmarks.ts
@@ -51,6 +51,7 @@ export interface BookmarkApi{
getTags: () => Promise<string[]>
delete: (bookmark: Bookmark | Bookmark[]) => Promise<void>
count: () => Promise<number>
+ downloadAll: () => Promise<string>
}
export interface BookmarkSearch{
@@ -140,6 +141,14 @@ const useBookmarkApi = (endpoint: MaybeRef<string>): BookmarkApi => {
return data.result;
}
+ const downloadAll = async () => {
+ //download the bookmarks as a html file
+ const { data } = await axios.get<string>(`${get(endpoint)}?export=true`, {
+ headers: { 'Content-Type': 'application/htlm' }
+ })
+ return data;
+ }
+
return {
list: listBookmarks,
add: addBookmark,
@@ -147,7 +156,8 @@ const useBookmarkApi = (endpoint: MaybeRef<string>): BookmarkApi => {
delete: deleteBookmark,
count: getItemsCount,
addMany,
- getTags
+ getTags,
+ downloadAll
}
}