Rudo
Posts: 0
Joined: Mon May 05, 2014 12:01 pm

Admin update other Users Info

I currently have an application and also created an Admin page where all the users orders for a product are listed. The admin must then read the order and update the status of the order, i.e set it to "Received". I have a list and each listed item has a button when the button is clicked that orders status must be updated by the admin.

I have stored each orders _id in a field called admin_update_ref and send that through to the Request.

It all works in the Tester but in the browser I get status 400 Bad Request.

Image Image Image

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Admin update other Users Info

Hello Rudo,

Does value of admin_update_ref match any records in DB? Could you provide a screenshot with detailed info of this error (content of response)?

Rudo
Posts: 0
Joined: Mon May 05, 2014 12:01 pm

Admin update other Users Info

Hello Evgene,

I'm not sure if it's maybe not getting that specific list items id but here is more screen shots.

This is how the interface looks at the moment, admin sees all users orders and he needs to click on the "Received" button to update the status. The red square is where I currently store the items _id as it is in the database.
Image

Here is the database I want to update. The red square is the same _id as the one in the list and the blue square is what I want to update.
Image

This is what i get in my console:
Image

Rudo
Posts: 0
Joined: Mon May 05, 2014 12:01 pm

Admin update other Users Info

Yes they do, I added new images. Hope they clear things out.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Admin update other Users Info

Hello, this is the wrong approach. You can see in the console that all of yours ids are passed to the service at the same time. You should on button click save the desired id in local storage and then invoke update_service. And in the mapping use this local storage variable. Please look at this tutorial: http://docs.appery.io/tutorials/build...
(section with delete_service, you should use this approach).

Rudo
Posts: 0
Joined: Mon May 05, 2014 12:01 pm

Admin update other Users Info

Yep! That works... What a dumb mistake, missed that completely!! Thank you for that super quick help! That was actually really easy... Thank you

Return to “Issues”