diff options
author | vnugent <public@vaughnnugent.com> | 2024-02-02 17:04:47 -0500 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2024-02-02 17:04:47 -0500 |
commit | dd5e5164262c5ff7ecf6db1003d41d81e6364c09 (patch) | |
tree | 9b5a34f0c57eeb55f7625f2eb60b191a494d1758 /front-end/src/store | |
parent | dab4c63543af688e67661b0091b49edb00e9557d (diff) |
add bookmark export, fix some ui stuff
Diffstat (limited to 'front-end/src/store')
-rw-r--r-- | front-end/src/store/bookmarks.ts | 12 |
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 } } |