Skip to content
Snippets Groups Projects
Commit 60f5bb30 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt :koala:
Browse files

refactor: group show routes under single entry point

parent f65271c4
No related branches found
No related tags found
No related merge requests found
......@@ -2,35 +2,44 @@ import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
const routes: RouteRecordRaw[] = [
{ path: '/', redirect: '/shows' },
{ path: '/shows', name: 'shows', component: () => import('@/Pages/MyShows.vue') },
{
path: '/shows/:showId',
name: 'show',
component: () => import('@/Pages/Show.vue'),
redirect: (to) => ({ path: `/shows/${to.params.showId}/episodes` }),
path: '/shows',
children: [
{
path: 'basic-data',
name: 'show-basic-data',
component: () => import('@/Pages/ShowBasicData.vue'),
path: '/shows',
name: 'shows',
component: () => import('@/Pages/MyShows.vue'),
},
{
path: 'episodes',
name: 'show-episodes',
component: () => import('@/Pages/ShowEpisodes.vue'),
},
{
path: 'episodes/:episodeId',
name: 'show-episode',
component: () => import('@/Pages/ShowEpisode.vue'),
redirect: (to) => ({
path: `/shows/${to.params.showId}/episodes/${to.params.episodeId}/details`,
}),
path: ':showId',
name: 'show',
component: () => import('@/Pages/Show.vue'),
redirect: (to) => ({ path: `/shows/${to.params.showId}/episodes` }),
children: [
{
path: 'details',
name: 'show-episode-details',
component: () => import('@/Pages/ShowEpisodeDetails.vue'),
path: 'basic-data',
name: 'show-basic-data',
component: () => import('@/Pages/ShowBasicData.vue'),
},
{
path: 'episodes',
name: 'show-episodes',
component: () => import('@/Pages/ShowEpisodes.vue'),
},
{
path: 'episodes/:episodeId',
name: 'show-episode',
component: () => import('@/Pages/ShowEpisode.vue'),
redirect: (to) => ({
path: `/shows/${to.params.showId}/episodes/${to.params.episodeId}/details`,
}),
children: [
{
path: 'details',
name: 'show-episode-details',
component: () => import('@/Pages/ShowEpisodeDetails.vue'),
},
],
},
],
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment