Dear Bubblers! I hope this time I’ll again get at awesome answers!
I have a GET request set up in API Connector that returns me a list of things in JSON that are available for the user.
The user could delete some of them by pressing the “DELETE” button.
Could you help me, please, how could I delete the one thing from repeating group as the button is clicked? Please, pay attention that information in the repeating group is received from the external API.
so if I understand correctly you’re not saving the value to the DB at any moment, you’re just using the API connector?
If that’s correct you could probably use custom state/hidden group to track the deleted items or their position in the list and filter the repeating group by this information (remember that performance-wise, all of this would happen client-side).
Hi @zifiry , check first if the api has a endpoint for delete. Because if it is just temporal removal, then that means the item would return on every refresh. Can you elborate on whether it is a temporal delete that wants to be carried out, or one from the api side or the data has to be saved on the database as some point in time?
@iwakinomotoye@alanpieczonka
As I press the “DELETE” button, I sent a POST request to change the status of the deleted card in the endpoint. It means that on the next request I will get elements that are not hidden.
What I do now: I’ve put an empty data source in my repeating group.
Then, as the DELETE button is clicked, I do the following:
Send a POST request to change the status of the item to “deleted” (disputeStatus = 4).
@zifiry
I’m not 100% if this will apply here but Bubble doesn’t re-make the API call if the input parameters are all the same since it assumes the output results will also be the same. The thing that often works is adding some sort of a fake parameter and then changing/incrementing it every time you want to refresh the data, which will force Bubble to re-make the call.
There is two thing, when a POST request is sent, does the response come with the same list (this time updated) of what you got when you initially called a GET request? If no is your answer. Then you need to call a GET request again, after the POST request has returned a response. Then it is the response from that GET request that ypu would use to repopulate the repeating group.