2022-08-26 14:08:58 +00:00
|
|
|
import { RouteRecordRaw } from "vue-router";
|
2021-10-10 14:24:12 +00:00
|
|
|
import { i18n } from "@/utils/i18n";
|
2020-07-09 15:24:28 +00:00
|
|
|
|
2022-08-26 14:08:58 +00:00
|
|
|
const t = i18n.global.t;
|
|
|
|
|
2020-07-09 15:24:28 +00:00
|
|
|
export enum DiscussionRouteName {
|
|
|
|
DISCUSSION_LIST = "DISCUSSION_LIST",
|
|
|
|
CREATE_DISCUSSION = "CREATE_DISCUSSION",
|
|
|
|
DISCUSSION = "DISCUSSION",
|
|
|
|
}
|
|
|
|
|
2022-08-26 14:08:58 +00:00
|
|
|
export const discussionRoutes: RouteRecordRaw[] = [
|
2020-07-09 15:24:28 +00:00
|
|
|
{
|
|
|
|
path: "/@:preferredUsername/discussions",
|
|
|
|
name: DiscussionRouteName.DISCUSSION_LIST,
|
2022-08-26 14:08:58 +00:00
|
|
|
component: (): Promise<any> =>
|
|
|
|
import("@/views/Discussions/DiscussionsListView.vue"),
|
2020-07-09 15:24:28 +00:00
|
|
|
props: true,
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
|
|
|
announcer: {
|
2022-08-26 14:08:58 +00:00
|
|
|
message: (): string => t("Discussions list") as string,
|
2021-10-10 14:24:12 +00:00
|
|
|
},
|
|
|
|
},
|
2020-07-09 15:24:28 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/@:preferredUsername/discussions/new",
|
|
|
|
name: DiscussionRouteName.CREATE_DISCUSSION,
|
2022-08-26 14:08:58 +00:00
|
|
|
component: (): Promise<any> => import("@/views/Discussions/CreateView.vue"),
|
2020-07-09 15:24:28 +00:00
|
|
|
props: true,
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
|
|
|
announcer: {
|
2022-08-26 14:08:58 +00:00
|
|
|
message: (): string => t("Create discussion") as string,
|
2021-10-10 14:24:12 +00:00
|
|
|
},
|
|
|
|
},
|
2020-07-09 15:24:28 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/@:preferredUsername/c/:slug/:comment_id?",
|
|
|
|
name: DiscussionRouteName.DISCUSSION,
|
2022-08-26 14:08:58 +00:00
|
|
|
component: (): Promise<any> =>
|
|
|
|
import("@/views/Discussions/DiscussionView.vue"),
|
2020-07-09 15:24:28 +00:00
|
|
|
props: true,
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: { requiredAuth: true, announcer: { skip: true } },
|
2020-07-09 15:24:28 +00:00
|
|
|
},
|
|
|
|
];
|