mobilizon/js/src/router/event.ts

49 lines
1.1 KiB
TypeScript
Raw Normal View History

2019-02-22 14:55:47 +01:00
import EventList from '@/views/Event/EventList.vue';
import Location from '@/views/Location.vue';
import CreateEvent from '@/views/Event/Create.vue';
import Event from '@/views/Event/Event.vue';
import { RouteConfig } from 'vue-router';
2019-02-22 14:55:47 +01:00
export enum EventRouteName {
EVENT_LIST = 'EventList',
CREATE_EVENT = 'CreateEvent',
EDIT_EVENT = 'EditEvent',
EVENT = 'Event',
LOCATION = 'Location',
}
export const eventRoutes: RouteConfig[] = [
2019-02-22 14:55:47 +01:00
{
path: '/events/list/:location?',
name: EventRouteName.EVENT_LIST,
component: EventList,
meta: { requiredAuth: false },
},
{
path: '/events/create',
name: EventRouteName.CREATE_EVENT,
component: CreateEvent,
meta: { requiredAuth: true },
},
{
path: '/events/:id/edit',
name: EventRouteName.EDIT_EVENT,
component: CreateEvent,
props: true,
meta: { requiredAuth: true },
},
{
path: '/location/new',
name: EventRouteName.LOCATION,
component: Location,
meta: { requiredAuth: true },
},
{
path: '/events/:uuid',
name: EventRouteName.EVENT,
component: Event,
props: true,
meta: { requiredAuth: false },
},
];