+ 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) {
+
+ console.log(bookmark.tag_names);
+ console.log(bookmark.tag_names.map((tag) => tag === 'linkblog' ? 'linkblog-posted' : tag));
+
+ 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}`
+ }
+ });
+
+ const data = await response.text();
+ console.log(url);
+ console.log(data);