You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JSON API spec requires that requests for a single record are returned as an object. Alternately, requests for collections, even if the collection only contains a single records, should be returned as an array.
Unfortunately, there isn't a great way to detect whether data coming into the plugin needs to call fetch or fetchAll depending on whether the user is requesting a single record or collection. I tried a few hacky things looking at Model#attributes and the Model#query._statements, but alas I broke it a few times.
Need a better way to determine this. May just revert to a flag that should be passed to the method.
The text was updated successfully, but these errors were encountered:
The JSON API spec requires that requests for a single record are returned as an object. Alternately, requests for collections, even if the collection only contains a single records, should be returned as an array.
Unfortunately, there isn't a great way to detect whether data coming into the plugin needs to call
fetch
orfetchAll
depending on whether the user is requesting a single record or collection. I tried a few hacky things looking atModel#attributes
and theModel#query._statements
, but alas I broke it a few times.Need a better way to determine this. May just revert to a flag that should be passed to the method.
The text was updated successfully, but these errors were encountered: