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

Issue with whitelist #215

Closed
bertho-zero opened this issue Aug 13, 2019 · 3 comments · Fixed by #218
Closed

Issue with whitelist #215

bertho-zero opened this issue Aug 13, 2019 · 3 comments · Fixed by #218

Comments

@bertho-zero
Copy link
Contributor

If in the options I add whitelist: [ '$search' ] then my service does not recognize $like etc, I have to add them all.

// does not work
[
  '$search'
]
// does work
[
  '$like',
  '$notlike',
  '$ilike',
  '$and',
  '$search'
]

I do not know if this is the desired behavior?

@daffl
Copy link
Member

daffl commented Aug 13, 2019

It always adds them to the list in https://github.com/feathersjs-ecosystem/feathers-knex/blob/master/lib/index.js#L44 - do you have the latest version (v6.0.1)?

@bertho-zero
Copy link
Contributor Author

I have the latest version.

const { whitelist = [] } = options;
super(Object.assign({
id: 'id',
whitelist: whitelist.concat([ '$like', '$notlike', '$ilike', '$and' ])
}, options));

If options.whitelist exists then the concat is overwritten.

@daffl
Copy link
Member

daffl commented Aug 14, 2019

🤦‍♂ Well, that makes sense. Fixed in 6.0.2

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 a pull request may close this issue.

2 participants