jeudi 6 août 2015

How to POST to a custom endpoint with Ember.js?

I need to submit a POST request to a custom endpoint in my Ember.js app. The request is to submit a user's email to reset password:

POST http://ift.tt/1P8UAed
Data: { user: { email: 'hello@example.com' } }

Essentially we are creating a new password because we are submitting a POST request. But the endpoint and the namespace don't match up. I think it would make sense to create some sort of custom method on the User model which submits the email. How can I submit a POST request to this endpoint, namespacing the data under user?




Aucun commentaire:

Enregistrer un commentaire