Skip to content

Commit 6281a6b

Browse files
hotfixes
1 parent 51f53ca commit 6281a6b

File tree

5 files changed

+23
-26
lines changed

5 files changed

+23
-26
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export default {
110110
111111
const redirectUriElement = document.createElement('input');
112112
redirectUriElement.name = 'redirect_uri';
113-
redirectUriElement.value = 'dashboard';
113+
redirectUriElement.value = 'home';
114114
form.appendChild(redirectUriElement);
115115
116116
const emailElement = document.createElement('input');

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export default {
8686
created() {
8787
if (this.isLoggedIn) {
8888
this.$router.push({
89-
name: 'dashboard',
89+
name: 'home',
9090
});
9191
}
9292

generator/templates/Crud/src/components/Resource.vue

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,8 @@ export default {
140140
return new Promise((resolve) => {
141141
this.showRequest(id)
142142
.then((response) => {
143-
let item;
144-
145-
if (this.modelType) {
146-
item = new this.modelType().mapResponse(response.data.data);
147-
} else {
148-
item = response.data.data;
149-
}
150-
151143
resolve({
152-
item,
144+
item: response.data.data,
153145
});
154146
});
155147
@@ -164,12 +156,7 @@ export default {
164156
if (this.createForm.valid) {
165157
this.createRequest(this.createForm.values)
166158
.then(() => {
167-
if (this.modelType) {
168-
this.createForm.values = new this.modelType();
169-
} else {
170-
this.createForm.values = {};
171-
}
172-
159+
this.createForm.values = {};
173160
resolve();
174161
})
175162
.catch((error) => {
@@ -183,15 +170,13 @@ export default {
183170
184171
});
185172
},
186-
handleUpdateRequest(selected) {
173+
handleUpdateRequest() {
187174
this.errors = {};
188175
this.$refs.updateForm.validate();
189176
190177
return new Promise((resolve, reject) => {
191178
process.nextTick(() => {
192179
if (this.updateForm.valid) {
193-
this.updateForm.values.id = selected[0].id;
194-
195180
this.updateRequest(this.updateForm.values)
196181
.then(() => resolve())
197182
.catch((error) => {
@@ -228,18 +213,21 @@ export default {
228213
if (this.beforeOpenCreate) {
229214
this.beforeOpenCreate(selected);
230215
}
216+
if (this.modelType) {
217+
this.createForm.values = new this.modelType();
218+
}
231219
},
232220
beforeOpenUpdateHandler(selected) {
233221
if (this.beforeOpenUpdate) {
234222
this.beforeOpenUpdate(selected);
235223
return;
236224
}
237-
238-
if (this.modelType) {
239-
this.updateForm.values = new this.modelType().mapResponse(selected[0]);
240-
} else {
225+
if (!this.modelType) {
241226
this.updateForm.values = selected[0];
227+
return;
242228
}
229+
230+
this.updateForm.values = new this.modelType().mapResponse(selected[0]);
243231
},
244232
},
245233
};

generator/templates/Crud/src/components/VuetifyResourceBaseForm.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ export default {
2929
},
3030
valid: {
3131
handler() {
32-
this.handleFormEmit();
32+
this.$emit('input', {
33+
values: this.values,
34+
valid: this.valid,
35+
});
3336
},
3437
},
3538
values: {
@@ -46,6 +49,12 @@ export default {
4649
};
4750
},
4851
methods: {
52+
validate() {
53+
this.$refs.form.validate();
54+
},
55+
clear() {
56+
this.$refs.form.reset();
57+
},
4958
setFormValues(values) {
5059
return values;
5160
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-cli-plugin-kingscode-scaffold",
3-
"version": "0.10.0",
3+
"version": "0.10.1",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)