fixed old search made new search default

This commit is contained in:
vabene1111
2021-07-29 16:55:57 +02:00
parent 8642298eda
commit 12a438752b
5 changed files with 28 additions and 6 deletions

View File

@ -133,7 +133,7 @@
:initial_selection="settings.search_keywords"
search_function="listKeywords" label="label"
style="flex-grow: 1; flex-shrink: 1; flex-basis: 0"
v-bind:placeholder="$t('Keywords')"></generic-multiselect>
v-bind:placeholder="$t('Keywords')" :limit="50"></generic-multiselect>
<b-input-group-append>
<b-input-group-text>
<b-form-checkbox v-model="settings.search_keywords_or" name="check-button"
@ -155,7 +155,7 @@
:initial_selection="settings.search_foods"
search_function="listFoods" label="name"
style="flex-grow: 1; flex-shrink: 1; flex-basis: 0"
v-bind:placeholder="$t('Ingredients')"></generic-multiselect>
v-bind:placeholder="$t('Ingredients')" :limit="20"></generic-multiselect>
<b-input-group-append>
<b-input-group-text>
<b-form-checkbox v-model="settings.search_foods_or" name="check-button"
@ -177,7 +177,7 @@
:initial_selection="settings.search_books"
search_function="listRecipeBooks" label="name"
style="flex-grow: 1; flex-shrink: 1; flex-basis: 0"
v-bind:placeholder="$t('Books')"></generic-multiselect>
v-bind:placeholder="$t('Books')" :limit="50"></generic-multiselect>
<b-input-group-append>
<b-input-group-text>
<b-form-checkbox v-model="settings.search_books_or" name="check-button"

View File

@ -37,6 +37,10 @@ export default {
label: String,
parent_variable: String,
initial_selection: Array,
limit: {
type: Number,
default: 10,
}
},
watch: {
initial_selection: function (newVal, oldVal) { // watch it
@ -50,7 +54,7 @@ export default {
search: function (query) {
let apiClient = new ApiApiFactory()
apiClient[this.search_function]({query: {query: query, limit: 10}}).then(result => {
apiClient[this.search_function]({query: {query: query, limit: this.limit}}).then(result => {
this.objects = result.data
})
},