change imports to use @/ for imports

This commit is contained in:
hay-kot 2021-02-09 19:15:17 -09:00
commit 83af92eaa3
35 changed files with 65 additions and 66 deletions

View file

@ -8,7 +8,7 @@ import myUtils from "./api/upload";
import category from "./api/category"; import category from "./api/category";
import meta from "./api/meta"; import meta from "./api/meta";
// import api from "../api"; // import api from "@/api";
export default { export default {
recipes: recipe, recipes: recipe,

View file

@ -1,6 +1,6 @@
const baseURL = "/api/"; const baseURL = "/api/";
import axios from "axios"; import axios from "axios";
import utils from "../utils"; import utils from "@/utils";
function processResponse(response) { function processResponse(response) {
try { try {

View file

@ -1,7 +1,7 @@
import { apiReq } from "./api-utils"; import { apiReq } from "./api-utils";
export default { export default {
// import api from "../api"; // import api from "@/api";
async uploadFile(url, fileObject) { async uploadFile(url, fileObject) {
let response = await apiReq.post(url, fileObject, { let response = await apiReq.post(url, fileObject, {
headers: { headers: {

View file

@ -26,7 +26,7 @@
</template> </template>
<script> <script>
import utils from "../../utils"; import utils from "@/utils";
import SearchDialog from "../UI/SearchDialog"; import SearchDialog from "../UI/SearchDialog";
export default { export default {
components: { components: {

View file

@ -20,8 +20,8 @@
</template> </template>
<script> <script>
import api from "../../api"; import api from "@/api";
import utils from "../../utils"; import utils from "@/utils";
import MealPlanCard from "./MealPlanCard"; import MealPlanCard from "./MealPlanCard";
export default { export default {
components: { components: {

View file

@ -85,8 +85,8 @@
</template> </template>
<script> <script>
import api from "../../api"; import api from "@/api";
import utils from "../../utils"; import utils from "@/utils";
import MealPlanCard from "./MealPlanCard"; import MealPlanCard from "./MealPlanCard";
export default { export default {
components: { components: {

View file

@ -254,8 +254,8 @@
<script> <script>
import draggable from "vuedraggable"; import draggable from "vuedraggable";
import api from "../../../api"; import api from "@/api";
import utils from "../../../utils"; import utils from "@/utils";
import BulkAdd from "./BulkAdd"; import BulkAdd from "./BulkAdd";
import ExtrasEditor from "./ExtrasEditor"; import ExtrasEditor from "./ExtrasEditor";
export default { export default {

View file

@ -161,7 +161,7 @@
</template> </template>
<script> <script>
import utils from "../../utils"; import utils from "@/utils";
export default { export default {
props: { props: {

View file

@ -17,10 +17,10 @@
</template> </template>
<script> <script>
import utils from "@/utils" import utils from "@/utils";
export default { export default {
props: { props: {
ingredients: Array ingredients: Array,
}, },
methods: { methods: {
generateKey(item, index) { generateKey(item, index) {

View file

@ -38,8 +38,8 @@
<script> <script>
import ImportDialog from "./ImportDialog"; import ImportDialog from "./ImportDialog";
import api from "../../../api"; import api from "@/api";
import utils from "../../../utils"; import utils from "@/utils";
export default { export default {
props: { props: {
backups: Array, backups: Array,

View file

@ -38,8 +38,8 @@
<script> <script>
import ImportDialog from "./ImportDialog"; import ImportDialog from "./ImportDialog";
import api from "../../../api"; import api from "@/api";
import utils from "../../../utils"; import utils from "@/utils";
export default { export default {
props: { props: {
backups: Array, backups: Array,

View file

@ -46,7 +46,7 @@
</template> </template>
<script> <script>
import api from "../../../api"; import api from "@/api";
export default { export default {
data() { data() {
return { return {
@ -84,7 +84,7 @@ export default {
methods: { methods: {
async getAvailableBackups() { async getAvailableBackups() {
let response = await api.backups.requestAvailable(); let response = await api.backups.requestAvailable();
response.templates.forEach((element) => { response.templates.forEach(element => {
this.availableTemplates.push(element); this.availableTemplates.push(element);
}); });
}, },
@ -101,7 +101,6 @@ export default {
templates: this.selectedTemplates, templates: this.selectedTemplates,
}; };
await api.backups.create(data); await api.backups.create(data);
this.loading = false; this.loading = false;

View file

@ -46,7 +46,7 @@
</template> </template>
<script> <script>
import api from "../../../api"; import api from "@/api";
import SuccessFailureAlert from "../../UI/SuccessFailureAlert"; import SuccessFailureAlert from "../../UI/SuccessFailureAlert";
import UploadBtn from "../../UI/UploadBtn"; import UploadBtn from "../../UI/UploadBtn";
import AvailableBackupCard from "./AvailableBackupCard"; import AvailableBackupCard from "./AvailableBackupCard";

View file

@ -126,7 +126,7 @@
</template> </template>
<script> <script>
import api from "../../../api"; import api from "@/api";
import draggable from "vuedraggable"; import draggable from "vuedraggable";
export default { export default {

View file

@ -56,8 +56,8 @@
<script> <script>
import UploadBtn from "../../UI/UploadBtn"; import UploadBtn from "../../UI/UploadBtn";
import utils from "../../../utils"; import utils from "@/utils";
import api from "../../../api"; import api from "@/api";
export default { export default {
props: { props: {
folder: String, folder: String,

View file

@ -41,7 +41,7 @@
<script> <script>
import MigrationCard from "./MigrationCard"; import MigrationCard from "./MigrationCard";
import SuccessFailureAlert from "../../UI/SuccessFailureAlert"; import SuccessFailureAlert from "../../UI/SuccessFailureAlert";
import api from "../../../api"; import api from "@/api";
export default { export default {
components: { components: {
MigrationCard, MigrationCard,
@ -78,7 +78,7 @@ export default {
}, },
async getAvailableMigrations() { async getAvailableMigrations() {
let response = await api.migrations.getMigrations(); let response = await api.migrations.getMigrations();
response.forEach((element) => { response.forEach(element => {
if (element.type === "nextcloud") { if (element.type === "nextcloud") {
this.migrations.nextcloud.availableImports = element.files; this.migrations.nextcloud.availableImports = element.files;
} else if (element.type === "chowdown") { } else if (element.type === "chowdown") {

View file

@ -53,7 +53,7 @@
return-object return-object
v-model="selectedTheme" v-model="selectedTheme"
@change="themeSelected" @change="themeSelected"
:rules="[(v) => !!v || $t('settings.theme.theme-is-required')]" :rules="[v => !!v || $t('settings.theme.theme-is-required')]"
required required
> >
</v-select> </v-select>
@ -136,7 +136,7 @@
</template> </template>
<script> <script>
import api from "../../../api"; import api from "@/api";
import ColorPickerDialog from "./ColorPickerDialog"; import ColorPickerDialog from "./ColorPickerDialog";
import NewThemeDialog from "./NewThemeDialog"; import NewThemeDialog from "./NewThemeDialog";
import Confirmation from "../../UI/Confirmation"; import Confirmation from "../../UI/Confirmation";
@ -186,7 +186,7 @@ export default {
//Change to default if deleting current theme. //Change to default if deleting current theme.
if ( if (
!this.availableThemes.some( !this.availableThemes.some(
(theme) => theme.name === this.selectedTheme.name theme => theme.name === this.selectedTheme.name
) )
) { ) {
await this.$store.dispatch("resetTheme"); await this.$store.dispatch("resetTheme");

View file

@ -56,7 +56,7 @@
</template> </template>
<script> <script>
import api from "../../../api"; import api from "@/api";
import TimePickerDialog from "./TimePickerDialog"; import TimePickerDialog from "./TimePickerDialog";
export default { export default {
components: { components: {

View file

@ -49,7 +49,7 @@
</template> </template>
<script> <script>
import api from "../../api"; import api from "@/api";
export default { export default {
data() { data() {

View file

@ -44,14 +44,14 @@
color="primary" color="primary"
block="block" block="block"
type="submit" type="submit"
>{{$t('login.sign-in')}}</v-btn >{{ $t("login.sign-in") }}</v-btn
> >
<v-btn <v-btn
v-else v-else
block="block" block="block"
type="submit" type="submit"
@click.prevent="options.isLoggingIn = true" @click.prevent="options.isLoggingIn = true"
>{{$t('login.sign-up')}}</v-btn >{{ $t("login.sign-up") }}</v-btn
> >
</v-form> </v-form>
</v-card-text> </v-card-text>
@ -72,7 +72,7 @@
</template> </template>
<script> <script>
import api from "../../api"; import api from "@/api";
export default { export default {
props: {}, props: {},
data() { data() {

View file

@ -40,7 +40,7 @@
</template> </template>
<script> <script>
import utils from "../../utils"; import utils from "@/utils";
export default { export default {
props: { props: {
name: String, name: String,

View file

@ -45,7 +45,7 @@
<script> <script>
import Fuse from "fuse.js"; import Fuse from "fuse.js";
import utils from "../../utils"; import utils from "@/utils";
export default { export default {
props: { props: {

View file

@ -9,7 +9,7 @@
</template> </template>
<script> <script>
import api from "../../api"; import api from "@/api";
export default { export default {
props: { props: {
url: String, url: String,

View file

@ -13,7 +13,7 @@
</template> </template>
<script> <script>
import api from "../api"; import api from "@/api";
import CardSection from "../components/UI/CardSection"; import CardSection from "../components/UI/CardSection";
import CategorySidebar from "../components/UI/CategorySidebar"; import CategorySidebar from "../components/UI/CategorySidebar";
export default { export default {

View file

@ -21,7 +21,7 @@
</template> </template>
<script> <script>
import api from "../api"; import api from "@/api";
import CardSection from "../components/UI/CardSection"; import CardSection from "../components/UI/CardSection";
import CategorySidebar from "../components/UI/CategorySidebar"; import CategorySidebar from "../components/UI/CategorySidebar";
export default { export default {
@ -55,7 +55,7 @@ export default {
}, },
methods: { methods: {
async buildPage() { async buildPage() {
this.homeCategories.forEach(async (element) => { this.homeCategories.forEach(async element => {
let recipes = await this.getRecipeByCategory(element.slug); let recipes = await this.getRecipeByCategory(element.slug);
recipes.position = element.position; recipes.position = element.position;
this.recipeByCategory.push(recipes); this.recipeByCategory.push(recipes);

View file

@ -74,8 +74,8 @@
</template> </template>
<script> <script>
import api from "../api"; import api from "@/api";
import utils from "../utils"; import utils from "@/utils";
import NewMeal from "../components/MealPlan/MealPlanNew"; import NewMeal from "../components/MealPlan/MealPlanNew";
import EditPlan from "../components/MealPlan/MealPlanEditor"; import EditPlan from "../components/MealPlan/MealPlanEditor";

View file

@ -49,8 +49,8 @@
</template> </template>
<script> <script>
import api from "../api"; import api from "@/api";
import utils from "../utils"; import utils from "@/utils";
export default { export default {
data() { data() {
return { return {

View file

@ -39,7 +39,7 @@
</template> </template>
<script> <script>
import api from "../api"; import api from "@/api";
import RecipeEditor from "../components/Recipe/RecipeEditor"; import RecipeEditor from "../components/Recipe/RecipeEditor";
import VJsoneditor from "v-jsoneditor"; import VJsoneditor from "v-jsoneditor";

View file

@ -56,8 +56,8 @@
</template> </template>
<script> <script>
import api from "../api"; import api from "@/api";
import utils from "../utils"; import utils from "@/utils";
import VJsoneditor from "v-jsoneditor"; import VJsoneditor from "v-jsoneditor";
import RecipeViewer from "../components/Recipe/RecipeViewer"; import RecipeViewer from "../components/Recipe/RecipeViewer";
import RecipeEditor from "../components/Recipe/RecipeEditor"; import RecipeEditor from "../components/Recipe/RecipeEditor";
@ -107,7 +107,7 @@ export default {
}, },
watch: { watch: {
$route: function () { $route: function() {
this.getRecipeDetails(); this.getRecipeDetails();
}, },
}, },

View file

@ -44,7 +44,7 @@ import General from "../components/Settings/General";
import Webhooks from "../components/Settings/Webhook"; import Webhooks from "../components/Settings/Webhook";
import Theme from "../components/Settings/Theme"; import Theme from "../components/Settings/Theme";
import Migration from "../components/Settings/Migration"; import Migration from "../components/Settings/Migration";
import api from "../api"; import api from "@/api";
import axios from "axios"; import axios from "axios";
export default { export default {

View file

@ -8,7 +8,7 @@ import AllRecipesPage from "./pages/AllRecipesPage";
import CategoryPage from "./pages/CategoryPage"; import CategoryPage from "./pages/CategoryPage";
import MeaplPlanPage from "./pages/MealPlanPage"; import MeaplPlanPage from "./pages/MealPlanPage";
import MealPlanThisWeekPage from "./pages/MealPlanThisWeekPage"; import MealPlanThisWeekPage from "./pages/MealPlanThisWeekPage";
import api from "./api"; import api from "@/api";
export const routes = [ export const routes = [
{ path: "/", component: HomePage }, { path: "/", component: HomePage },
@ -24,7 +24,7 @@ export const routes = [
{ {
path: "/meal-plan/today", path: "/meal-plan/today",
beforeEnter: async (_to, _from, next) => { beforeEnter: async (_to, _from, next) => {
await todaysMealRoute().then((redirect) => { await todaysMealRoute().then(redirect => {
next(redirect); next(redirect);
}); });
}, },

View file

@ -1,4 +1,4 @@
import api from "../../api"; import api from "@/api";
const state = { const state = {
showRecent: true, showRecent: true,
@ -30,10 +30,10 @@ const actions = {
}; };
const getters = { const getters = {
getShowRecent: (state) => state.showRecent, getShowRecent: state => state.showRecent,
getShowLimit: (state) => state.showLimit, getShowLimit: state => state.showLimit,
getCategories: (state) => state.categories, getCategories: state => state.categories,
getHomeCategories: (state) => state.homeCategories, getHomeCategories: state => state.homeCategories,
}; };
export default { export default {

View file

@ -1,4 +1,4 @@
import api from "../../api"; import api from "@/api";
import Vuetify from "../../plugins/vuetify"; import Vuetify from "../../plugins/vuetify";
function inDarkMode(payload) { function inDarkMode(payload) {
@ -60,9 +60,9 @@ const actions = {
}; };
const getters = { const getters = {
getActiveTheme: (state) => state.activeTheme, getActiveTheme: state => state.activeTheme,
getDarkMode: (state) => state.darkMode, getDarkMode: state => state.darkMode,
getIsDark: (state) => state.isDark, getIsDark: state => state.isDark,
}; };
export default { export default {

View file

@ -1,6 +1,6 @@
import Vue from "vue"; import Vue from "vue";
import Vuex from "vuex"; import Vuex from "vuex";
import api from "../api"; import api from "@/api";
import createPersistedState from "vuex-persistedstate"; import createPersistedState from "vuex-persistedstate";
import userSettings from "./modules/userSettings"; import userSettings from "./modules/userSettings";
import language from "./modules/language"; import language from "./modules/language";
@ -64,11 +64,11 @@ const store = new Vuex.Store({
getters: { getters: {
// //
getSnackText: (state) => state.snackText, getSnackText: state => state.snackText,
getSnackActive: (state) => state.snackActive, getSnackActive: state => state.snackActive,
getSnackType: (state) => state.snackType, getSnackType: state => state.snackType,
getRecentRecipes: (state) => state.recentRecipes, getRecentRecipes: state => state.recentRecipes,
}, },
}); });

View file

@ -1,4 +1,4 @@
// import utils from "../../utils"; // import utils from "@/utils";
// import Vue from "vue"; // import Vue from "vue";
// import Vuetify from "./plugins/vuetify"; // import Vuetify from "./plugins/vuetify";
import { vueApp } from "./main"; import { vueApp } from "./main";