+ async getBookmarks() {
+
+ const url = join(internals.apiUrl, 'bookmarks') + '?q=%23linkblog';
+ const response = await fetch(url, {
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: `Token ${internals.apiToken}`
+ }
+ });
+ const data = await response.json();
+
+ return data.results;
+ },
+
+ async updateBookmark(bookmark) {
+
+ const url = join(internals.apiUrl, 'bookmarks', `${bookmark.id}`)
+ const response = await fetch(url, {
+ method: 'PATCH',
+ body: JSON.stringify(
+ {
+ tag_names: bookmark.tag_names.map((tag) => tag === 'linkblog' ? 'linkblog-posted' : tag)
+ }
+ ),
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: `Token ${internals.apiToken}`
+ }
+ });