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

fix: Use find method where args are for find #1225

Merged
merged 3 commits into from
Aug 17, 2022
Merged

fix: Use find method where args are for find #1225

merged 3 commits into from
Aug 17, 2022

Conversation

Crash--
Copy link
Contributor

@Crash-- Crash-- commented Aug 17, 2022

The idea is to check if there is some options
related to _find. If yes, then we should use
this route instead of {normal|all}_docs

Fix #1216

The idea is to check if there is some options
related to _find. If yes, then we should use
this route instead of {normal|all}_docs
const hasFindOptions = queryDefinition => {
const { selector, partialFilter, sort, fields } = queryDefinition
if (selector || partialFilter || sort || fields) return true
return false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't you prefer return selector || partialFilter || sort || fields ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not have any pref. At first, this method was more complicated than just returning the fields. Since I wrote it that way, I will commit that way. Maybe next time you'll change it :p

packages/cozy-client/src/StackLink.spec.js Show resolved Hide resolved
Copy link
Contributor

@paultranvan paultranvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Crash-- Crash-- merged commit e554465 into master Aug 17, 2022
@Crash-- Crash-- deleted the fix/Where branch August 17, 2022 14:45
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.

.where selector is mandatory when using .select or .partialIndex
2 participants