fix failing build

This commit is contained in:
hay-kot 2021-08-08 21:15:20 -08:00
parent bde885dc84
commit 625dbcdea5
7 changed files with 16 additions and 21 deletions

View File

@ -1,4 +1,5 @@
import { BaseCRUDAPI } from "./_base"; import { BaseCRUDAPI } from "./_base";
import { Recipe } from "~/types/api-types/recipe";
const prefix = "/api"; const prefix = "/api";
@ -6,6 +7,7 @@ export interface Category {
name: string; name: string;
id: number; id: number;
slug: string; slug: string;
recipes?: Recipe[];
} }
export interface CreateCategory { export interface CreateCategory {

View File

@ -1,4 +1,5 @@
import { BaseCRUDAPI } from "./_base"; import { BaseCRUDAPI } from "./_base";
import { Recipe } from "~/types/api-types/admin";
const prefix = "/api"; const prefix = "/api";
@ -6,6 +7,7 @@ export interface Tag {
name: string; name: string;
id: number; id: number;
slug: string; slug: string;
recipes?: Recipe[];
} }
export interface CreateTag { export interface CreateTag {

View File

@ -11,10 +11,10 @@
</v-btn-toggle> </v-btn-toggle>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn-toggle v-model="match" tile group color="primary accent-3" mandatory @change="emitMulti"> <v-btn-toggle v-model="match" tile group color="primary accent-3" mandatory @change="emitMulti">
<v-btn small :value="false"> <v-btn small :value="false" class="text-uppercase">
{{ $t("search.and") }} {{ $t("search.and") }}
</v-btn> </v-btn>
<v-btn small :value="true"> <v-btn small :value="true" class="text-uppercase">
{{ $t("search.or") }} {{ $t("search.or") }}
</v-btn> </v-btn>
</v-btn-toggle> </v-btn-toggle>

View File

@ -32,7 +32,7 @@ export default {
css: [{ src: "~/assets/main.css" }, { src: "~/assets/style-overrides.scss" }], css: [{ src: "~/assets/main.css" }, { src: "~/assets/style-overrides.scss" }],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins // 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 // Auto import components: https://go.nuxtjs.dev/config-components
components: true, 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 Configuration: https://go.nuxtjs.dev/config-build
build: { build: {
// https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-build
analyze: true,
babel: { babel: {
plugins: [["@babel/plugin-proposal-private-property-in-object", { loose: true }]], 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,
}, },
}; };

View File

@ -31,7 +31,9 @@ export default defineComponent({
}, },
methods: { methods: {
assignSorted(val: Array<Recipe>) { assignSorted(val: Array<Recipe>) {
this.category.recipes = val; if (this.category) {
this.category.recipes = val;
}
}, },
}, },
}); });

View File

@ -31,7 +31,9 @@ export default defineComponent({
}, },
methods: { methods: {
assignSorted(val: Array<Recipe>) { assignSorted(val: Array<Recipe>) {
this.tag.recipes = val; if (this.tag) {
this.tag.recipes = val;
}
}, },
}, },
}); });

View File

@ -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);
// });
};