improved search food api performance

This commit is contained in:
vabene1111
2023-02-11 16:27:41 +01:00
parent 44236f611e
commit 924d1cb71b
3 changed files with 10 additions and 3 deletions

View File

@@ -155,8 +155,9 @@ export default {
pageSize: this.limit,
query: query,
limit: this.limit,
options: {query: {simple: 1}}, // for API endpoints that support a simple view
}
console.log(query, options)
this.genericAPI(this.model, this.Actions.LIST, options).then((result) => {
this.objects = this.sticky_options.concat(result.data?.results ?? result.data)
if (this.nothingSelected && this.objects.length > 0) {

View File

@@ -359,6 +359,7 @@ export const ApiMixin = {
}
},
methods: {
// if passing parameters that are not part of the offical schema of the endpoint use parameter: options: {query: {simple: 1}}
genericAPI: function (model, action, options) {
let setup = getConfig(model, action)
if (setup?.config?.function) {