Run prettier
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
2022-03-15 12:49:53 +00:00
parent d8d713f841
commit 61a534610f
42 changed files with 1485 additions and 1187 deletions

View File

@ -1,30 +1,75 @@
import { createRouter, createWebHistory, RouteLocationNormalized } from 'vue-router'
import Dashboard from '../pages/Dashboard.vue';
import Login from '../pages/Login.vue';
import Index from '../pages/Index.vue';
import Register from '../pages/Register.vue';
import Account from '@/pages/Account.vue';
import Settings from '../pages/Settings.vue';
import Budgeting from '../pages/Budgeting.vue';
import BudgetSidebar from '../pages/BudgetSidebar.vue';
import {
createRouter,
createWebHistory,
RouteLocationNormalized,
} from "vue-router";
import Dashboard from "../pages/Dashboard.vue";
import Login from "../pages/Login.vue";
import Index from "../pages/Index.vue";
import Register from "../pages/Register.vue";
import Account from "@/pages/Account.vue";
import Settings from "../pages/Settings.vue";
import Budgeting from "../pages/Budgeting.vue";
import BudgetSidebar from "../pages/BudgetSidebar.vue";
const routes = [
{ path: "/", name: "Index", component: Index },
{ path: "/dashboard", name: "Dashboard", component: Dashboard, meta: { requiresAuth: true } },
{ path: "/login", name: "Login", component: Login, meta: { hideForAuth: true } },
{ path: "/register", name: "Register", component: Register, meta: { hideForAuth: true } },
{ path: "/budget/:budgetid/budgeting", name: "Budget", redirect: (to : RouteLocationNormalized) =>
'/budget/' + to.params.budgetid + '/budgeting/' + new Date().getFullYear() + '/' + new Date().getMonth(),
meta: { requiresAuth: true }
},
{ path: "/budget/:budgetid/budgeting/:year/:month", name: "Budget with date", components: { default: Budgeting, sidebar: BudgetSidebar }, props: true, meta: { requiresAuth: true } },
{ path: "/budget/:budgetid/Settings", name: "Budget Settings", components: { default: Settings, sidebar: BudgetSidebar }, props: true, meta: { requiresAuth: true } },
{ path: "/budget/:budgetid/account/:accountid", name: "Account", components: { default: Account, sidebar: BudgetSidebar }, props: true, meta: { requiresAuth: true } },
]
{ path: "/", name: "Index", component: Index },
{
path: "/dashboard",
name: "Dashboard",
component: Dashboard,
meta: { requiresAuth: true },
},
{
path: "/login",
name: "Login",
component: Login,
meta: { hideForAuth: true },
},
{
path: "/register",
name: "Register",
component: Register,
meta: { hideForAuth: true },
},
{
path: "/budget/:budgetid/budgeting",
name: "Budget",
redirect: (to: RouteLocationNormalized) =>
"/budget/" +
to.params.budgetid +
"/budgeting/" +
new Date().getFullYear() +
"/" +
new Date().getMonth(),
meta: { requiresAuth: true },
},
{
path: "/budget/:budgetid/budgeting/:year/:month",
name: "Budget with date",
components: { default: Budgeting, sidebar: BudgetSidebar },
props: true,
meta: { requiresAuth: true },
},
{
path: "/budget/:budgetid/Settings",
name: "Budget Settings",
components: { default: Settings, sidebar: BudgetSidebar },
props: true,
meta: { requiresAuth: true },
},
{
path: "/budget/:budgetid/account/:accountid",
name: "Account",
components: { default: Account, sidebar: BudgetSidebar },
props: true,
meta: { requiresAuth: true },
},
];
const router = createRouter({
history: createWebHistory(),
routes,
})
history: createWebHistory(),
routes,
});
export default router
export default router;