Skip to content

Commit ac9db44

Browse files
Add fields and more
1 parent e36078f commit ac9db44

27 files changed

Lines changed: 735 additions & 74 deletions

File tree

generator/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@ module.exports = (api, options) => {
2929
});
3030
}
3131

32-
if (options.useCrud) {
33-
api.extendPackage({
34-
dependencies: {
35-
'@kingscode/vuetify-resource': '^2.0.3',
36-
},
37-
});
38-
api.render('./templates/Crud', options);
39-
}
40-
4132
if (options.useGithubDeployments) {
4233
api.render('./templates/Deployment', options);
4334
}
@@ -52,6 +43,15 @@ module.exports = (api, options) => {
5243
api.render('./templates/Authorisation', options);
5344
}
5445

46+
if (options.useCrud) {
47+
api.extendPackage({
48+
dependencies: {
49+
'@kingscode/vuetify-resource': '^2.0.3',
50+
},
51+
});
52+
api.render('./templates/Crud', options);
53+
}
54+
5555
if (options.plugins.includes('sentry')) {
5656
api.extendPackage({
5757
dependencies: {

generator/templates/Authorisation/src/api/endpoints/user.js

Lines changed: 0 additions & 41 deletions
This file was deleted.

generator/templates/Authorisation/src/components/Authorisation/LoginCard.vue renamed to generator/templates/Authorisation/src/components/authorisation/LoginCard.vue

File renamed without changes.

generator/templates/Authorisation/src/components/Authorisation/PasswordForgottenCard.vue renamed to generator/templates/Authorisation/src/components/authorisation/PasswordForgottenCard.vue

File renamed without changes.

generator/templates/Authorisation/src/components/Authorisation/PasswordResetCard.vue renamed to generator/templates/Authorisation/src/components/authorisation/PasswordResetCard.vue

File renamed without changes.

generator/templates/Authorisation/src/components/Authorisation/RegisterCard.vue renamed to generator/templates/Authorisation/src/components/authorisation/RegisterCard.vue

File renamed without changes.

generator/templates/Authorisation/src/routes/guards/AuthorisationGuard.js renamed to generator/templates/Authorisation/src/router/guards/AuthorisationGuard.js

File renamed without changes.

generator/templates/Authorisation/src/routes/routes/authorisation.js renamed to generator/templates/Authorisation/src/router/routes/authorisation.js

File renamed without changes.

generator/templates/Authorisation/src/views/authorisation/AuthorisationCallback.vue

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,14 @@
66

77
<script lang="js">
88
import { getFragment } from '@/application/util/url';
9-
import admin from '@/router/routes/admin.js';
10-
import { mapActions, mapMutations, mapState } from 'vuex';
9+
import { mapMutations } from 'vuex';
1110
1211
export default {
1312
name: 'AuthorisationCallback',
1413
methods: {
1514
...mapMutations({
1615
setAuthorisationToken: 'authorisation/setAuthorisationToken',
1716
}),
18-
...mapActions({
19-
fetchProfile: 'authorisation/fetchProfile',
20-
}),
21-
},
22-
computed: {
23-
...mapState('authorisation', ['isAdmin']),
2417
},
2518
async created() {
2619
const redirectUri = this.$route.query.redirect_uri;
@@ -30,10 +23,6 @@ export default {
3023
if (!token) throw new Error('AuthorisationCallback::created token hash not found');
3124
3225
this.setAuthorisationToken(token);
33-
await this.fetchProfile();
34-
if (this.isAdmin) {
35-
this.$router.addRoutes([admin]);
36-
}
3726
this.$router.push({ name: redirectUri });
3827
},
3928
};
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { getPaginated } from '@/api/implementation/app/wrapper.js';
2+
import { destroy, get, post, put } from '@/api/implementation/app';
3+
4+
function index(page, perPage, search, sortBy, descending, params) {
5+
return getPaginated('user', page, perPage, search, sortBy, descending, params);
6+
}
7+
8+
function show(id) {
9+
return get(`user/${id}`);
10+
}
11+
12+
function create(user) {
13+
return post('user', user);
14+
}
15+
16+
function update(user) {
17+
return put(`user/${user.id}`, user);
18+
}
19+
20+
function remove(userId) {
21+
return destroy(`user/${userId}`);
22+
}
23+
24+
export {
25+
index,
26+
show,
27+
create,
28+
update,
29+
remove,
30+
};

0 commit comments

Comments
 (0)