-
-
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
Has many metadata #2878
Has many metadata #2878
Conversation
2680704
to
615f58a
Compare
This should be good to merge. |
@@ -0,0 +1,9 @@ | |||
function cloneNull(source) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export default function cloneNull
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected, thanks!
@@ -144,6 +145,9 @@ ManyRelationship.prototype.computeChanges = function(records) { | |||
ManyRelationship.prototype.fetchLink = function() { | |||
var self = this; | |||
return this.store.findHasMany(this.record, this.link, this.relationshipMeta).then(function(records) { | |||
var meta = self.store.metadataFor(self.relationshipMeta.type); | |||
self.manyArray.set('meta', cloneNull(meta)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a potential problem here, if you make a request for a record, set some metadata, and then fetch the link, do not set the metadata, this array will end up with wrong metadata. Not sure how to fix this right now
2904134
to
c71260d
Compare
Rebased #2878 and added a test from #2996 Added metadata support behind a feature flag, for hasMany relationships. For now, until we refactor the internals, the store internally pushes hasMany metadata around in the `meta` key next to `links` and `data`. This might lead to overriding meta attribtues with meta relationships, but will be solved by the upcoming change of the internals to JSONAPI format
Superseded by #3221 |
Rebased #2878 and added a test from #2996 Added metadata support behind a feature flag, for hasMany relationships. For now, until we refactor the internals, the store internally pushes hasMany metadata around in the `meta` key next to `links` and `data`. This might lead to overriding meta attribtues with meta relationships, but will be solved by the upcoming change of the internals to JSONAPI format
No description provided.