Open Gonksy opened 2 years ago
Future implementations to consider:
Client side: When users input a comma or leave the tag input box, wrap the written tag like so: Provides instant feedback and makes users know they're tagging properly.
This could require rethinking how the tags get sent from user to the controller and subsequently how they're handled. (ie. as separate contents of spans rather than 1 single string)
comma separated is the best way to do this, 100% agree.
We also need to consider the edge case when a document already has tags in the array and the user adds a few more (check if empty and repeat the function but push to the array rather than create a new one) we could save a bit of code by starting with an empty array during document creation and just pushing to it in either use case.
love the visual documentation 👍
comma separated is the best way to do this, 100% agree.
We also need to consider the edge case when a document already has tags in the array and the user adds a few more (check if empty and repeat the function but push to the array rather than create a new one) we could save a bit of code by starting with an empty array during document creation and just pushing to it in either use case.
Ooh I hadn't considered the ability to add tags after creating the link. I think we can achieve that through a separate put request with its own route and controller. Could have it not push duplicate tags to the tags array. Could also probably give the user a way to remove tags, but I think that might be a stretch goal.
Current implementation:
User inputs tags as a string in an input
Controller separates input string by each comma, trims the white spaces around each tag, then saves it to an array defined in the tab schema
Gets saved in the database as an array