jaydata icon indicating copy to clipboard operation
jaydata copied to clipboard

v1.5.5 RC find() + include() error

Open gabrielsimplicio opened this issue 8 years ago • 3 comments

Hi, I'm using jaydata v1.5.5 RC + odata v4, but I can't use

context.EntityName.include("Relationship").find(id).then(...)

In v1.4.0 it worked. Thanks.

gabrielsimplicio avatar Jun 30 '16 01:06 gabrielsimplicio

Hello @gabrielsimplicio , What's the error or what does "I can't use" mean? Please elaborate the issue and we resolve it accordingly.

robesz avatar Jun 30 '16 05:06 robesz

@robesz I just ran into this as well, the error I see is:

TypeError: Cannot read property 'length' of undefined(…)

Debugging a bit, it looks like it enters the VisitFindExpression in jaydata.js, at which point this: if (source !== expression.source) return _index.Container.createFindExpression(source); Evaluates as false, so even though the expression entered this function with params populated, it is substituted with the source expression which does not have params populated.

Then when it hits this line in the VisitFindExpression function in the oDataProvider.js (line 335): if (expression.params.length === 1) {

It throws an error since params is undefined (even though I've passed an Id).

anderslyman avatar Aug 02 '16 16:08 anderslyman

btw, I'm on the 1.5.5 RC

I'm available to do a screenshare if that would be helpful

anderslyman avatar Aug 02 '16 17:08 anderslyman