Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] include may not have a .relation and just be a { [modelName]: true } sometimes #308

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abhilashmurthy
Copy link

Used to fail when my model has a default scope in its model.json

scope: {
  include: ['model1', 'model2']
}

and I make a filter REST API call with
/api/model?include=model3

Turns out the requested include was never included in the serialised result because

  1. isLoopbackInclude checked for an incomplete condition, which overrode isJSONAPIInclude -> added ctx.args.filter.include to make it correct
  2. setRequestedInclude did not account for object of type { [modelName]: true } -> made it do so

@coveralls
Copy link

Coverage Status

Coverage remained the same at 94.554% when pulling d28e324 on abhilashmurthy:fix-requested-include-pojo into a7083aa on digitalsadhu:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants