findHasMany (store, snapshot, url) Promise
Called by the store in order to fetch a JSON array for the unloaded records in a has-many relationship that were originally specified as a URL (inside of links
).
For example, if your original payload looks like this:
{ "post": { "id": 1, "title": "Rails is omakase", "links": { "comments": "/posts/1/comments" } } }
This method will be called with the parent record and /posts/1/comments
.
The findHasMany
method will make an Ajax (HTTP GET) request to the originally specified URL.
The format of your links
value will influence the final request URL via the urlPrefix
method:
Links beginning with
//
,http://
,https://
, will be used as is, with no further manipulation.Links beginning with a single
/
will have the current adapter'shost
value prepended to it.Links with no beginning
/
will have a parentURL prepended to it, via the current adapter'sbuildURL
.
Parameters:
-
store
DS.Store
-
snapshot
DS.Snapshot
-
url
String
Returns:
-
Promise
- promise
Please login to continue.