-
-
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
pass snapshot through to urlForFindHasMany and urlForFindBelongsTo #4308
Conversation
Not sure what is going on with appveyor here. I took a look at the logs, but wasn't able to discern the problem. |
79d8bd7
to
edf0139
Compare
@@ -1279,7 +1279,7 @@ if (isEnabled('ds-improved-ajax')) { | |||
|
|||
case 'findHasMany': | |||
case 'findBelongsTo': | |||
let url = this.buildURL(type.modelName, id, null, requestType); | |||
let url = this.buildURL(type.modelName, id, snapshots, requestType); |
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 want to pass the snapshot
here.
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.
thanks, I am still confused about when snapshot vs snapshots is passed in here.
Is snapshot
always a DS.Snapshot
and this snapshots
always DS.SnapshotRecordArray
?
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.
Yes. Basically the snapshot
here represents the "owner" of the relationship.
You also need to pass the
Don't worry too much about that, unfortunately AppVeyor fails sporadically. Restarting the CI by a force push helps most of the time... Apart from my comments, this looks great! |
edf0139
to
b18a4c0
Compare
So I updated the docs and added the snapshot where you pointed to above. I think I am still a little lost on what is going on between the call to |
@@ -1154,6 +1154,10 @@ var RESTAdapter = Adapter.extend(BuildURLMixin, { | |||
buildQuery(snapshot) { | |||
let query = {}; | |||
|
|||
if (snapshot) { | |||
query.adapterOptions = snapshot.adapterOptions | |||
} |
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.
This isn't needed, the main thing this PR tries to solve is just passing the snapshot
to the urlForFindBelongsTo
and urlForFindHasMany
hook. Sorry if my comments confused you here...
The |
359fc21
to
85a1220
Compare
ok updated, thanks for walking me through that. I was lost there for a bit. |
Yeah, this can be quite confusing. But it looks good now! Thanks @trevorrjohn! |
related to: #4304