Why is hashtag a list of texts? It looks like you want only 1 hashtag for each topic?
In your second post for example, how does it supposed to look like? mention2, and mention1 should not be there simply? Because they were already in the list?
If the new one should have been mention4 and mention5 would that be fine? What would happen if another person enters mention4 in a single post again in that case?
I need it to work like a post on any social network.
In a post, a user can enter a list of # topics.
Example:
Post User: Today is a beautiful day to develop. #development#bubble#study#apply#repeat
My goal is that when a user enters the #, it saves all items in the post except those that are already saved in the database.
As for the post mention2, mention1, it was created when I tried to create the post with the hashtags, to test, they are not working, so I saved it like this, and the result in the automatic search in the new post field, both appear as a single item, that is the problem.
@execsy.mp I agree with @hergin - if I’m understanding this correctly:
the Hashtag field should be a simple text, not a list
you create a new Topic for each #text in a post, based on a cleaner conditional - it could look something like Search for topics:first item is empty, with the constraint hashtag = #text
you add a field list of Topics in your Post data type
@execsy.mp you would need to extract each #hashtag from your multiline input, and create a new Assuntos for each one that does not match an already existing Assuntos for the same #hashtag.
You then need to combine the list of newly created Assuntos + already existing Assuntos in that multiline input, and add them to your list of Assuntos in the ADSPostagens record.