pipeline and improvements
Some checks failed
Deploy Miniplan / build (push) Failing after 2m23s

This commit is contained in:
walamana
2024-08-07 20:08:52 +02:00
parent 24f14da9b2
commit dde21c3ac5
54 changed files with 1651 additions and 237 deletions

View File

@@ -1,14 +1,30 @@
import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/PlanView.vue'
import {API} from "@/services/api";
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
path: '/:id',
name: 'home',
component: HomeView
},
{
path: "/",
name: "home-redirect",
component: null,
beforeEnter: async (to, from) => {
const groups = (await API.getPlans())
.sort((a, b) => a.id - b.id)
return {
name: "home",
params: {
id: groups.length > 0 ? groups[groups.length - 1].id : 0
}
}
}
}
]
})