Closed rgant closed 8 years ago
Yes i can see the problem here.. I have created many adapter tests but also need to create tests that interact via the data store also!!
At the moment the adapter always returns an array back to js-data. For single objects this must be an object. This applies to all responses to non xxxxAll requests
I am not certain where in the code this all gets handled. If I can be of any help to you, please just point me in the right direction. As always, thanks so much!
I started looking at this. BUT will be a few hours before I get back to it. I have to do some paid work as well.
One question. Are you developing an open source project or work related. Would be interested to see it. As you can probably tell. I haven't got a reference project that uses this. I have started work on one but have still got a fair way to go on it.
I'm working on an app to help charitable organizations and nonprofits calculate their impact with the idea being that they can build a social network of such organizations to help identify and share best practices and to help get more funding. The current project is our web application for funders and grantees, but it's backed by an API that we want to open up to other organizations doing charitable work.
Setting the option
cacheResponse
tofalse
on a.find
operation results in the error ""attrs" must be an object!" from js-data.find call:
Tracing through the code it appears that the cacheResponse flag is checked here in js-data:
If the code takes the 'true' path then there is no error, however if to tries to call createInstance directly then
attrs
is an[Object Array]
instead of an[Object Object]
and the call toDSUtils.isObject
rejects it.