Deleting item from Array List


#1

Hi there,
I am currently having difficulty removing an item from my array list.
I am using backendless as my database - so please advise if this issue should be directed to the backendless forum
When my particular page appears, i am able to retrieve the data through my GET request. It is displayed in a dynamic table - no issue there.
I have followed the Checklist App tutorial with regards to Deleting an Item and all i have managed to do is to remove the cell from the Table View but the data remains within backendless
I have linked the ObjectID’s together through the Path parameter of the DELETE request as stated in the tutorial.
Unsure of what I am missing. If you need any additional information,please let me know

Thanks for you help in advance


#2

Hello @fconversano, Sounds like you have the correct idea. You can update the UI that way and send a DELETE request to the backend. You can also rebuild the display by sending a DELETE request and then a fresh GET request afterwards too. The latter may be better because it ensures the data in the backend and app are sanitized and properly updating together. This way you don’t update the UI even if an error code comes back on the DELETE request. That way you’re using a single source of truth for all UI updates.


#3

Hi @wade

Thanks for this. I added in an Alert just to test if there is fact actually an error occurring and there was.
Every time i run the DELETE request i get this message:

“Could not parse request with message: Error decoding json body: null, status code 400, headers DELETE /56084FA3-9484-D7E5-FFC6-988697506300/4B12967C-3B49-A003-FF26-BDE2AAA0AB00/data/ShoppingCart/E39B3B3A-DE9B-F706-FF28-0B20216EBC00”

If i run this exact same DELETE request in my backendless console, it deletes the item requested
Just unsure on how to resolve this.

Thank you


#4

Hi @fconversano, Errors like this oftentimes appear when your Swagger file isn’t setup correctly to what’s being accomplished in your backend. If the Swagger syntax isn’t a strong suit for you, hit up their support so they can see how you have your backend end setup and can see if the specifics in your Swagger file match up with what’s expected in them receiving your requests and how the response is being returned to your app. Then re-upload the Swagger file into Dropsource to test. It’s probably a small inaccuracy occurring within the expectation and the Swagger representation here.