mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 12:18:45 -05:00
improved search food api performance
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user