From 8fd47d0e458cd63b36a196e9b7dcda0eb0402a33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sabina=20Gu=C5=A1i=C4=87?= Date: Wed, 7 Jan 2026 18:22:46 +0100 Subject: [PATCH] fix: add 'untagged' tag to bookmarks without tags on creation --- frontend/components/Bookmark/NewBookmarkCard.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/components/Bookmark/NewBookmarkCard.tsx b/frontend/components/Bookmark/NewBookmarkCard.tsx index 024094f6..eb3a3db4 100644 --- a/frontend/components/Bookmark/NewBookmarkCard.tsx +++ b/frontend/components/Bookmark/NewBookmarkCard.tsx @@ -104,7 +104,7 @@ export default function NewBookmarkCard() { const handleOnSubmit = async ( submittedBmk: NewBookmarkForm, - actions: any, + actions: any ) => { // Get the last inputted string and all the tags already entered. let tags: Tag[] = strTags.map((t) => ({ title: t, id: -1 })); @@ -112,6 +112,12 @@ export default function NewBookmarkCard() { // FIXME tags.push({ title: tagInput, id: -1 }); } + + // Add default "untagged" tag if user has not provided any + if (!tags.length) { + tags = [{ title: "untagged", id: -1 }]; + } + let newBkmk: Bookmark = { id: -1, title: submittedBmk.title || submittedBmk.url,