debianize-mobilizon/js/src/router/discussion.ts
Thomas Citharel 0693defd03
Move all routes to async components
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2020-10-14 18:59:36 +02:00

35 lines
1.0 KiB
TypeScript

import { RouteConfig } from "vue-router";
export enum DiscussionRouteName {
DISCUSSION_LIST = "DISCUSSION_LIST",
CREATE_DISCUSSION = "CREATE_DISCUSSION",
DISCUSSION = "DISCUSSION",
}
export const discussionRoutes: RouteConfig[] = [
{
path: "/@:preferredUsername/discussions",
name: DiscussionRouteName.DISCUSSION_LIST,
component: () =>
import(/* webpackChunkName: "DiscussionsList" */ "@/views/Discussions/DiscussionsList.vue"),
props: true,
meta: { requiredAuth: false },
},
{
path: "/@:preferredUsername/discussions/new",
name: DiscussionRouteName.CREATE_DISCUSSION,
component: () =>
import(/* webpackChunkName: "CreateDiscussion" */ "@/views/Discussions/Create.vue"),
props: true,
meta: { requiredAuth: true },
},
{
path: "/@:preferredUsername/c/:slug/:comment_id?",
name: DiscussionRouteName.DISCUSSION,
component: () =>
import(/* webpackChunkName: "Discussion" */ "@/views/Discussions/Discussion.vue"),
props: true,
meta: { requiredAuth: false },
},
];