mobilizon/js/src/router/discussion.ts
Thomas Citharel 9c9f1385fb
Introduce group posts
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2020-07-30 16:55:35 +02:00

35 lines
1,001 B
TypeScript

import { RouteConfig } from "vue-router";
import CreateDiscussion from "@/views/Discussions/Create.vue";
import DiscussionsList from "@/views/Discussions/DiscussionsList.vue";
import discussion from "@/views/Discussions/Discussion.vue";
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: DiscussionsList,
props: true,
meta: { requiredAuth: false },
},
{
path: "/@:preferredUsername/discussions/new",
name: DiscussionRouteName.CREATE_DISCUSSION,
component: CreateDiscussion,
props: true,
meta: { requiredAuth: true },
},
{
path: "/@:preferredUsername/c/:slug/:comment_id?",
name: DiscussionRouteName.DISCUSSION,
component: discussion,
props: true,
meta: { requiredAuth: false },
},
];