Skip to content

fix(getSettings): allow empty call #664

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

Merged
merged 1 commit into from
Feb 8, 2018
Merged

fix(getSettings): allow empty call #664

merged 1 commit into from
Feb 8, 2018

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Feb 8, 2018

Summary

in f91cdde accidentally a first argument was necessary.

Result

no more error with empty arguments

@Haroenv Haroenv requested a review from Jerska February 8, 2018 16:59
@Haroenv Haroenv merged commit 3ef50fa into develop Feb 8, 2018
@Haroenv Haroenv deleted the fix/getSettings branch February 8, 2018 17:13
.then(function() {return index.getSettings({advanced: 1});})
.then(get('attributesForFaceting'))
.then(_.partialRight(t.deepEqual, ['searchable(category)'], 'Settings were get (advanced)'))
.then(index.getSettings)
Copy link

Choose a reason for hiding this comment

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

Here getSettings is called with one argument (result from previous Promise, even undefined wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good call, amending the test to be really with no arguments

*/
Index.prototype.getSettings = function(opts, callback) {
if (arguments.length === 1 || typeof opts === 'function') {
Copy link

Choose a reason for hiding this comment

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

You could also have added opts = opts || {} after the original if no? Would that have worked?

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.

3 participants