mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-08 07:38:26 -05:00
add debounce to food search on recipe edit
This commit is contained in:
@@ -711,6 +711,7 @@ import GenericModalForm from "@/components/Modals/GenericModalForm"
|
|||||||
|
|
||||||
import mavonEditor from 'mavon-editor'
|
import mavonEditor from 'mavon-editor'
|
||||||
import 'mavon-editor/dist/css/index.css'
|
import 'mavon-editor/dist/css/index.css'
|
||||||
|
import _debounce from "lodash/debounce";
|
||||||
// use
|
// use
|
||||||
Vue.use(mavonEditor)
|
Vue.use(mavonEditor)
|
||||||
|
|
||||||
@@ -1088,7 +1089,7 @@ export default {
|
|||||||
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_FETCH, err)
|
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_FETCH, err)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
searchFoods: function (query) {
|
searchFoods: _debounce(function (query) {
|
||||||
let apiFactory = new ApiApiFactory()
|
let apiFactory = new ApiApiFactory()
|
||||||
|
|
||||||
this.foods_loading = true
|
this.foods_loading = true
|
||||||
@@ -1112,7 +1113,7 @@ export default {
|
|||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_FETCH, err)
|
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_FETCH, err)
|
||||||
})
|
})
|
||||||
},
|
}, 500),
|
||||||
fileCreated: function (data) {
|
fileCreated: function (data) {
|
||||||
if (data !== "cancel") {
|
if (data !== "cancel") {
|
||||||
this.step_for_file_create.file = data.item
|
this.step_for_file_create.file = data.item
|
||||||
|
|||||||
Reference in New Issue
Block a user