Page 1 of 1
Users not able to delete their posts
Posted: Tue Jan 14, 2014 11:57 pm
by Victor Fagerström
I'm trying to make it possible for a logged in user to delete a post that he has created. Creating posts and listing them works fine. The delete service doesn't...
I create a local storage variable which I pass the _id from list response and bind it to a label-components text-param (as described in http://docs.appery.io/tutorials/build... ). It works fine and I can alert a unique id of every post that has been created.
On a delete button created in every post I first bind the selected posts listed _id to the local storage component and after this invoke the delete service.
In the delete service I bind the local storage variable holding the current posts _id to object_id, bind the sessionToken to X-Appery-Session-Token and X-Appery-Database-Id is preset to {database_id}.
When clicking any posts delete button nothing is deleted from the database... Why?
Users not able to delete their posts
Posted: Wed Jan 15, 2014 12:23 am
by Illya Stepanov
Hi Victor,
Have you test your Delete service? What are you getting in the Test tab?
Users not able to delete their posts
Posted: Wed Jan 15, 2014 12:36 am
by Victor Fagerström
I am trying to now. Am i doing it right if I'm passing the session id (ex. 7489e886-dd63-4922-85bc-639ff7612cd4) to X-Appery-Session-Token and the id of an item (ex. 52d5d0ebe4b06de3a9a7b8fd) to object_id in the TEST tab?
Users not able to delete their posts
Posted: Wed Jan 15, 2014 12:45 am
by Victor Fagerström
Users not able to delete their posts
Posted: Wed Jan 15, 2014 3:10 am
by Illya Stepanov
Victor - is this app shared with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a?
Users not able to delete their posts
Posted: Wed Jan 15, 2014 6:38 am
by Victor Fagerström
Users not able to delete their posts
Posted: Wed Jan 15, 2014 9:24 am
by Maryna Brodina
Hello! In service settings in URL should be pre{object_id}/pre instead pre<object_id>/pre
Users not able to delete their posts
Posted: Wed Jan 15, 2014 9:34 am
by Victor Fagerström
OH so simple, works perfectly now 
Thanks Maryna, you're doing a good job!