Skip to content

Commit 20ef643

Browse files
Merge pull request #19 from kingscode/KCI-64
[KCI-64] Update scaffold with new API implementation & error-handling.
2 parents 574a6f6 + c4c012f commit 20ef643

File tree

40 files changed

+598
-553
lines changed

40 files changed

+598
-553
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Kings Code scaffold
22

3+
## Installation
34

4-
```vue create my-app
5+
```bash
6+
vue create my-app
57
cd my-app
68
vue add vuetify
79
vue add kingscode-scaffold

generator/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ const fs = require('fs');
44
module.exports = (api, options) => {
55
api.extendPackage({
66
dependencies: {
7-
'axios': '^0.18.0',
8-
"dayjs": "^1.8.19",
7+
'axios': '^0.19.2',
8+
'dayjs': '^1.8.19',
99
'vuex': '^3.1.2',
1010
'vuex-persistedstate': '^2.5.4',
1111
'lodash.clonedeep': '^4.5.0',
1212
'css-vars-ponyfill': '^2.1.2',
13+
'vue-router': '3.3.4',
1314
},
1415
});
1516
if (options.plugins.includes('fontawesomepro')) {
@@ -23,7 +24,7 @@ module.exports = (api, options) => {
2324
if (options.useCrud) {
2425
api.extendPackage({
2526
dependencies: {
26-
'@kingscode/vuetify-resource': '^1.1.2',
27+
'@kingscode/vuetify-resource': '^1.4.1',
2728
},
2829
});
2930
api.render('./templates/Crud', options);

generator/templates/Authorisation/src/api/authorisation/login.js

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

generator/templates/Authorisation/src/api/authorisation/logout.js

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

generator/templates/Authorisation/src/api/authorisation/register.js

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import {post} from '../../implementation/app/wrapper';
2+
3+
export default function (email, password) {
4+
return post('auth/login', {
5+
email: email,
6+
password: password,
7+
});
8+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import {post} from '../../implementation/app/wrapper.js';
2+
3+
export default function () {
4+
return post('auth/logout');
5+
}
6+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import {post} from '../../implementation/app/wrapper.js';
2+
3+
function passwordForgotten(email) {
4+
return post('password/forgotten', {
5+
email: email,
6+
});
7+
}
8+
9+
function passwordReset(token, email, password, passwordConfirmation) {
10+
return post('password/reset', {
11+
token: token,
12+
email: email,
13+
password: password,
14+
password_confirmation: passwordConfirmation
15+
});
16+
}
17+
18+
export {
19+
passwordForgotten,
20+
passwordReset,
21+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import {post} from '../../implementation/app/wrapper.js';
2+
3+
export default function (email, name) {
4+
return post('registration', {
5+
email, name,
6+
});
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import {post} from '../../implementation/app/wrapper.js';
2+
3+
export default function (email) {
4+
return post('password/forgotten', {
5+
email: email,
6+
});
7+
}

0 commit comments

Comments
 (0)