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
| 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.
We want to pass the snapshot here.
There was a problem hiding this comment.
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.
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 |
|
|
||
| if (snapshot) { | ||
| query.adapterOptions = snapshot.adapterOptions | ||
| } |
There was a problem hiding this comment.
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