-
-
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
Have this.store.pushPayload(type, payload) return records #3576
Comments
Here is a bit more about my use case: We are using
let modelClass = this.store.modelFor('account');
let serializer = this.store.serializerFor('account');
let normalizedPayload = serializer.normalizeSingleResponse(this.store, modelClass, payload, null, true);
let account = this.store.push(normalizedPayload);
let account = this.store.pushPayload('account', payload);
account === undefined If it is not desirable to break the current API (as this request would) then could we get some other convenience function to handle this use case? |
Bump. It seems odd to me that Looking at the code, it seems easy enough to update the store and serializers. Would a PR be accepted to fix this? |
We ran into the same problem couple times in our app. It would be a really appreciated addition! |
Closing since the PR was merged |
Cross-Linking to RFC#161, which addresses the problem raised in this issue. |
any updates on this? facing the same issue because pushPayload does not return anything back. So how can I use normalized response? |
@bbansalWolfPack we decided not to move forward with pushPayload return. We intend on deprecating |
As best I can tell this seems to the currently suggested approach: https://www.emberjs.com/blog/2018/04/13/ember-3-1-released.html#toc_feature-flag-code-ds-pushpayload-return-code-4-of-4 |
It would be a nice convenience if
pushPayload
returned the resulting records. Otherwise we have to go through the manual process of normalizing the payload and usingthis.store.push
The text was updated successfully, but these errors were encountered: