0
votes

im building a password update module on my Ember App. My API it's designed as:

PUT users/:id/password

so you should pass

{
    currentpass: "123456",
    newpass: "123456"
}

Is it possible and recommendable to use Ember DS for this case? What approach do you guys recommend? A different API design? no Ember Data ?

Regards!

1
So far i have only found ember.api.actions that can do the trick - Oscar Yañez
If your intention really is as simple as you describe, then I would write a simple ajax request and be done with it. You could use Ember.$.post() (jQuery post()) for this purpose. But you hardly need Ember at all for this. Ember-data will work well for you as soon as you are doing more with the user, such as changing the user name, displaying the user info in multiple templates, looking at the user's posts/comments/etc. - pauldoerwald
it's just that building the api path for the request doesn't feel right when the ember DS can make it for me. Thanks for the advice, using the ember-api-actions package is the most suitable approach i have found till now - Oscar Yañez
You can also use ember-ajax to write custom ajax requests, which is part of ember-cli and has a lot of community support - Sid
Thanks Oscar; with your response to my comment I better understand what you were trying to do, and in fact you gave me a hint for the very next problem I ran into; I'm now using ember-api-actions as well! - pauldoerwald

1 Answers

0
votes

I ended up using ember-api-actions. So i can use nested resources along with Ember Data