Implement tag management with SQLite; update save and retrieve endpoints
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
export function saveTags(tags) {
|
||||
export async function saveTags(newTags) {
|
||||
const existingTags = await loadTags();
|
||||
const allTags = Array.from(new Set([...existingTags, ...newTags]));
|
||||
|
||||
return fetch('/save-tags', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ tags })
|
||||
body: JSON.stringify({ tags: allTags })
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user