diff --git a/vue/src/apps/RecipeEditView/RecipeEditView.vue b/vue/src/apps/RecipeEditView/RecipeEditView.vue index 337b0a728..8947e610f 100644 --- a/vue/src/apps/RecipeEditView/RecipeEditView.vue +++ b/vue/src/apps/RecipeEditView/RecipeEditView.vue @@ -1149,11 +1149,9 @@ export default { this.recipe.properties = this.recipe.properties.filter(p => p.id !== recipe_property.id) }, searchKeywords: function (query) { - let apiFactory = new ApiApiFactory() this.keywords_loading = true - apiFactory - .listKeywords(query, undefined, undefined, 1, this.options_limit) + this.genericAPI(this.Models.KEYWORD, this.Actions.LIST, {'query': query, 'page': 1, 'pageSize': this.options_limit}) .then((response) => { this.keywords = response.data.results this.keywords_loading = false @@ -1163,13 +1161,10 @@ export default { }) }, searchFiles: function (query) { - let apiFactory = new ApiApiFactory() - this.files_loading = true - apiFactory - .listUserFiles({query: {query: query}}) + this.genericAPI(this.Models.USERFILE, this.Actions.LIST, {'query': query}) .then((response) => { - this.files = response.data + this.files = response.data.results this.files_loading = false }) .catch((err) => { @@ -1188,11 +1183,9 @@ export default { }) }, searchUnits: function (query) { - let apiFactory = new ApiApiFactory() this.units_loading = true - apiFactory - .listUnits(query, 1, this.options_limit) + this.genericAPI(this.Models.UNIT, this.Actions.LIST, {'query': query, 'page': 1, 'pageSize': this.options_limit}) .then((response) => { this.units = response.data.results let unique_units = this.units.map(u => u.name) @@ -1212,11 +1205,9 @@ export default { }) }, searchFoods: _debounce(function (query) { - let apiFactory = new ApiApiFactory() this.foods_loading = true - apiFactory - .listFoods(query, undefined, undefined, 1, this.options_limit) + this.genericAPI(this.Models.FOOD, this.Actions.LIST, {'query': query, 'page': 1, 'pageSize': this.options_limit}) .then((response) => { this.foods = response.data.results let unique_foods = this.foods.map(f => f.name) diff --git a/vue/src/apps/RecipeSearchView/RecipeSearchView.vue b/vue/src/apps/RecipeSearchView/RecipeSearchView.vue index 5b098a1f4..c2b5eba46 100644 --- a/vue/src/apps/RecipeSearchView/RecipeSearchView.vue +++ b/vue/src/apps/RecipeSearchView/RecipeSearchView.vue @@ -878,7 +878,6 @@ import GenericMultiselect from "@/components/GenericMultiselect" import MealPlanEditModal from "@/components/MealPlanEditModal.vue" import RecipeCard from "@/components/RecipeCard" import { useMealPlanStore } from "@/stores/MealPlanStore" -import { ApiApiFactory } from "@/utils/openapi/api" import { ApiMixin, ResolveUrlMixin, StandardToasts, ToastMixin } from "@/utils/utils" Vue.use(VueCookies) @@ -1127,10 +1126,6 @@ export default { this.loadMealPlan() this.refreshData(false) }) - let apiClient = new ApiApiFactory() - apiClient.retrieveSpace(window.ACTIVE_SPACE_ID).then((r) => { - this.use_plural = r.data.use_plural - }) this.$i18n.locale = window.CUSTOM_LOCALE moment.locale(window.CUSTOM_LOCALE) this.debug = localStorage.getItem("DEBUG") == "True" || false diff --git a/vue/src/components/Buttons/RecipeSwitcher.vue b/vue/src/components/Buttons/RecipeSwitcher.vue index f001cc52b..8b6bc2340 100644 --- a/vue/src/components/Buttons/RecipeSwitcher.vue +++ b/vue/src/components/Buttons/RecipeSwitcher.vue @@ -87,11 +87,11 @@