Victor Fagerström
Posts: 0
Joined: Sun Dec 01, 2013 1:03 pm

Users not able to delete their posts

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.

  1. 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.

  2. 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?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Users not able to delete their posts

Hi Victor,

Have you test your Delete service? What are you getting in the Test tab?

Victor Fagerström
Posts: 0
Joined: Sun Dec 01, 2013 1:03 pm

Users not able to delete their posts

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?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Users not able to delete their posts

Victor - is this app shared with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a?

Victor Fagerström
Posts: 0
Joined: Sun Dec 01, 2013 1:03 pm

Users not able to delete their posts

It is now

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Users not able to delete their posts

Hello! In service settings in URL should be pre{object_id}/pre instead pre<object_id>/pre

Victor Fagerström
Posts: 0
Joined: Sun Dec 01, 2013 1:03 pm

Users not able to delete their posts

OH so simple, works perfectly now :)

Thanks Maryna, you're doing a good job!

Return to “Issues”