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
Forgot to say that my response for the resource from the api is a raw resource object.
{ "userId": 1, "id": 1, "title": "sunt aut ", "body": "quia et " }
My findings.
I traced the issue to this method:
return restmod.mixin(function() {
this.define('Model.unpack', function(_resource, _raw) {
var name = null,
links = this.getProperty('jsonLinks', 'included'),
meta = this.getProperty('jsonMeta', 'meta');
...
...
return _raw[name]; // here it returns undefined
});
and on the return line, the name has a value that is not present as property on the _raw object.
I have used the following:
jsonRootSingle: '.' // but of course this is sily
Hack to get it working.
restmodProvider.rebase({
$config: {
jsonRootSingle: '_single', // hack
},
$hooks: {
'after-request' : function (_res) {
// this hack is needed because $find is giving the error...
// ...Record $decode expected an object
// comment out the line below to get the error
_res.data = Array.isArray(_res.data) ? _res.data : {_single: _res.data};
}
}
});
The text was updated successfully, but these errors were encountered:
Hello, this project is fantastic, thank you for the creators, they saved lots of hours that i can use for other things. Thanks.
Today i started using it and after spending half a day with it, my first issue arrived.
I try to use the find to get the data for a resource
and i get the error:
I made a code snipped to replicate the problem. Here it is http://codepen.io/anon/pen/LNpMXK
Forgot to say that my response for the resource from the api is a raw resource object.
{ "userId": 1, "id": 1, "title": "sunt aut ", "body": "quia et " }
My findings.
I traced the issue to this method:
and on the return line, the name has a value that is not present as property on the _raw object.
I have used the following:
Hack to get it working.
The text was updated successfully, but these errors were encountered: