Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion frontend/components/Bookmark/NewBookmarkCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,20 @@ 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 }));
if (tagInput) {
// 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 }];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer it on the retrieval side rather than the submission side.
For example, the frontend when it retrieves all the bookmarks the untagged tag to the bookmark rather than saving it on the backend.

The reason this is suggested, is we then have to manage untagged bookmarks on the backend then. Such as when a user adds a tag to a bookmark that has been tagged as untagged, now we have to check the tags when tags are added and in this not an optimal option.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, I’ll fix this as soon as possible.

}

let newBkmk: Bookmark = {
id: -1,
title: submittedBmk.title || submittedBmk.url,
Expand Down