Implement tag management with SQLite; update save and retrieve endpoints

This commit is contained in:
2025-02-02 19:17:35 +01:00
parent c98aea1b06
commit 37a7e5e67a
4 changed files with 80 additions and 23 deletions

View File

@@ -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 })
});
}