-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
collection.create does not return a jqXHR #1155
Comments
Yes! A easy way to access the jqXHR object would be most useful. |
I'm afraid that As to the semantics of the failure cases ... I think they're valid. You may have a reference to a model that was unable to be added to the server, in the same way you can do this:
... and have a reference to a model that was unable to be saved to the server. |
Fair enough. I agree that it's ok to have a reference to a model who failed to persist. I just want to know if it failed or succeeded. One can use the |
… returning an XHR
I made a mistake in #1111 and documented that
collection.create
returns ajqXHR
. I've just noticed, however, that it does not. It returns the created model.However, this seems incorrect to me. it seems out of place compared to the other persistence methods. Furthermore, the
jqXHR
is not accessible in any way and thus there is no way to observe the outcome of the request.As for a reference to the model, there are several scenarios:
{wait: true}
, success - the model is added to the collection.{wait: true}
, failure - there is no need for a reference to the model.{wait: false}
, success - the model was added to the collection.{wait: false}
, failure - the model was added to the collection.Case number 4 is a bit problematic, but could be easily circumvented by removing the model on a failed request with
{wait: false}
.Thoughts?
The text was updated successfully, but these errors were encountered: