-
-
Notifications
You must be signed in to change notification settings - Fork 87
Can't use .then() on ember-ajax's Promise after code 200 #101
Comments
Hmm... Does |
Errors, if any, get handled correctly by the I've tested my endpoint, and I realized it returns nothing, only giving a 200 status code. I've also tested the first endpoint I mention, which work fine. That gives a 201, along with a JSON with user details. Does my endpoint perhaps have to return something to |
The answer seem to be "yes". I've added some random data to my response (instead of just a code) and consequently Is this considered logical, or is this a bug? Thanks for your help! EDIT Seems like the 200 coming from my backend should be a 204. This may solve the above for |
Interesting. If If |
@alexlafroscia I'm finding plenty of references to E.g.: http://stackoverflow.com/questions/10839771/jquery-ajaxerror-runs-even-if-the-response-is-ok-200 I'm closing this, since it seems not specific to |
Sure thing! Glad it's not an Ember-Ajax issue 😁 |
So, I'm using ember-ajax to call my user registration endpoint without problems, see code below. The endpoint returns a 201.
Note the use of
registerSuccess
, which I use in my template to inform the user of success.However, when I try to do the same thing for my 'change password' endpoint (code below), I'm not able to use
.then()
on the promise for some reason. This endpoint returns a 200 code, which is the only difference between the two. I made a hack below where I setpwChangeSuccess
to True first, but that's ugly since the page will always display success first, even if it fails.I thought about customizing 'isSuccess`, but in debugging it showed that I never even reach this method.
I'm not sure if this is a bug, or if I'm doing something wrong.
Any help is appreciated. Thanks!
The text was updated successfully, but these errors were encountered: