1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
import IndexComponent from './pages/index.vue';
import NewComponent from './pages/new.vue';
import userPermissionsQuery from './queries/user_permissions.query.graphql';
import defaultClient from './graphql_client';
export default [
{
path: '/',
component: IndexComponent,
},
{
path: '/new',
component: NewComponent,
async beforeEnter(to, from, next) {
const {
data: {
group: {
userPermissions: { createCustomEmoji },
},
},
} = await defaultClient.query({
query: userPermissionsQuery,
variables: {
groupPath: document.body.dataset.groupFullPath,
},
});
if (!createCustomEmoji) {
next({ path: '/' });
} else {
next();
}
},
},
];
|