-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Mutable id on first request #2558
Comments
The issue is that it's a single record, so a REST call like |
@knownasilya There has been some discussion of implementing a |
@bmac not really, since I don't know the final id, so I can't do |
@knownasilya have you seen this workaround? #1576 (comment) |
I just ran into the same problem. I'd say the main problem here is that the store pushes a record with an ID that doesn't exist on the server. The store should blindly accept whatever the server responded as the records ID. Plus I think the second parameter for |
That fails if your api does sideloading and doesn't tell you what the primary record is. Would findQueryOne work for your usecase? |
The fact that the store pushes a record with an ID that is not an ID at all is a bug. If the backends response contained |
Well, |
I meant that using
Either this or it should just return an empty list - the method name is
{
"model": {
"id": 1,
"indexedfield": "ident",
"otherfield": "other value"
}
}
So ember-data somehow invented a new record out of nothing. |
|
I'm not exactly sure what you mean. I have no observers for the record, but only computed properties
agreed, lets focus on the store creating a ghost record |
I think |
Yes sir. |
So I have the following,
The server returns:
Where the
id !== token
, but token will always return the same data. So this doesn't currently work, since ED sets the Model.id to the token, even after the record from the server returns.I could do
but is that the best way? Ultimately I always want to GET the model with the token, but PUT and DELETE by the id.
The text was updated successfully, but these errors were encountered: