Skip to content

Commit 77903b1

Browse files
author
Conan Crawford
committed
fixed runtime option merging
1 parent c89e4af commit 77903b1

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const plugin = {
2121
const installOptions = {...defaultOptions, ...pluginOptions}
2222

2323
components.Repo.prototype.search = function (term, singleOptions = {}) {
24-
let options = {...installOptions, singleOptions}
2524
const fields = this.entity.fields()
2625

2726
// -- default search keys are all model fields
@@ -37,6 +36,9 @@ const plugin = {
3736
searchKeys = singleOptions.keys
3837
}
3938
const primaryKey = this.entity.primaryKey
39+
40+
let options = {...installOptions, ...singleOptions}
41+
4042
if (!options.searchPrimaryKey) {
4143
let pkIndex = searchKeys.indexOf(primaryKey)
4244
if (pkIndex !== -1) {

0 commit comments

Comments
 (0)