diff --git a/frontend/api/class-interfaces/categories.ts b/frontend/api/class-interfaces/categories.ts index 5356b2c8d6ce..f49851a14a31 100644 --- a/frontend/api/class-interfaces/categories.ts +++ b/frontend/api/class-interfaces/categories.ts @@ -1,4 +1,5 @@ import { BaseCRUDAPI } from "./_base"; +import { Recipe } from "~/types/api-types/recipe"; const prefix = "/api"; @@ -6,6 +7,7 @@ export interface Category { name: string; id: number; slug: string; + recipes?: Recipe[]; } export interface CreateCategory { diff --git a/frontend/api/class-interfaces/tags.ts b/frontend/api/class-interfaces/tags.ts index df26ca16ba99..c63402c34ca4 100644 --- a/frontend/api/class-interfaces/tags.ts +++ b/frontend/api/class-interfaces/tags.ts @@ -1,4 +1,5 @@ import { BaseCRUDAPI } from "./_base"; +import { Recipe } from "~/types/api-types/admin"; const prefix = "/api"; @@ -6,6 +7,7 @@ export interface Tag { name: string; id: number; slug: string; + recipes?: Recipe[]; } export interface CreateTag { diff --git a/frontend/components/Domain/Recipe/RecipeSearchFilterSelector.vue b/frontend/components/Domain/Recipe/RecipeSearchFilterSelector.vue index ffb794fdbde7..8239f75197e0 100644 --- a/frontend/components/Domain/Recipe/RecipeSearchFilterSelector.vue +++ b/frontend/components/Domain/Recipe/RecipeSearchFilterSelector.vue @@ -11,10 +11,10 @@ - + {{ $t("search.and") }} - + {{ $t("search.or") }} diff --git a/frontend/nuxt.config.js b/frontend/nuxt.config.js index 8538cde1ad20..ab4522e1f7b5 100644 --- a/frontend/nuxt.config.js +++ b/frontend/nuxt.config.js @@ -32,7 +32,7 @@ export default { css: [{ src: "~/assets/main.css" }, { src: "~/assets/style-overrides.scss" }], // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins - plugins: ["~/plugins/globals.js", { src: "~/plugins/axios", mode: "server" }], + plugins: ["~/plugins/globals.js"], // Auto import components: https://go.nuxtjs.dev/config-components components: true, @@ -265,12 +265,13 @@ export default { }, }, - // Build Configuration: https://go.nuxtjs.dev/config-build // Build Configuration: https://go.nuxtjs.dev/config-build build: { + // https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-build + analyze: true, babel: { plugins: [["@babel/plugin-proposal-private-property-in-object", { loose: true }]], }, - // transpile: process.env.NODE_ENV !== "production" ? [/@vue[\\/]composition-api/] : null + transpile: process.env.NODE_ENV !== "production" ? [/@vue[\\/]composition-api/] : null, }, }; diff --git a/frontend/pages/recipes/categories/_slug.vue b/frontend/pages/recipes/categories/_slug.vue index 4ef4a990ff74..cefa02063f1c 100644 --- a/frontend/pages/recipes/categories/_slug.vue +++ b/frontend/pages/recipes/categories/_slug.vue @@ -31,7 +31,9 @@ export default defineComponent({ }, methods: { assignSorted(val: Array) { - this.category.recipes = val; + if (this.category) { + this.category.recipes = val; + } }, }, }); diff --git a/frontend/pages/recipes/tags/_slug.vue b/frontend/pages/recipes/tags/_slug.vue index 65ce9ef2c86f..e859def87186 100644 --- a/frontend/pages/recipes/tags/_slug.vue +++ b/frontend/pages/recipes/tags/_slug.vue @@ -31,7 +31,9 @@ export default defineComponent({ }, methods: { assignSorted(val: Array) { - this.tag.recipes = val; + if (this.tag) { + this.tag.recipes = val; + } }, }, }); diff --git a/frontend/plugins/axios.js b/frontend/plugins/axios.js deleted file mode 100644 index d921544341c6..000000000000 --- a/frontend/plugins/axios.js +++ /dev/null @@ -1,14 +0,0 @@ -export default ({ $axios, store }) => { - // $axios.onResponse((response) => { - // console.log(`[${response.status}] ${response.request.path}`); - // }); - - // $axios.onError((err) => { - // console.log(`[${err.response && err.response.status}] ${err.response && err.response.request.path}`); - // console.log(err.response && err.response.data); - // }); - - // $axios.onRequest((config) => { - // console.log("Making request to " + config.url); - // }); -};