Skip to content

Commit b8d127f

Browse files
committed
Merge branch 'next' of github.com:devforth/adminforth into feature/AdminForth/1213/add-ability-to-restore-unsaved
2 parents 93c2e98 + 825287f commit b8d127f

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

adminforth/spa/src/views/CreateView.vue

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -225,23 +225,25 @@ async function saveRecord() {
225225
});
226226
if (response?.error && response?.error !== 'Operation aborted by hook') {
227227
showErrorTost(response.error);
228-
}
229-
saving.value = false;
230-
if (route.query.returnTo) {
231-
router.push(<string>route.query.returnTo);
232228
} else {
233-
router.push({
234-
name: 'resource-show',
235-
params: {
236-
resourceId: route.params.resourceId,
237-
primaryKey: response.newRecordId
238-
}
239-
});
240-
alert({
241-
message: t('Record created successfully!'),
242-
variant: 'success'
243-
});
229+
saving.value = false;
230+
if (route.query.returnTo) {
231+
router.push(<string>route.query.returnTo);
232+
} else {
233+
router.push({
234+
name: 'resource-show',
235+
params: {
236+
resourceId: route.params.resourceId,
237+
primaryKey: response.newRecordId
238+
}
239+
});
240+
alert({
241+
message: t('Record created successfully!'),
242+
variant: 'success'
243+
});
244+
}
244245
}
246+
saving.value = false;
245247
}
246248
247249
function scrollToInvalidField() {

adminforth/spa/src/views/EditView.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ async function saveRecord() {
198198
if (columnIsUpdated) {
199199
updates[key] = record.value[key];
200200
}
201+
saving.value = false;
201202
}
202203
203204
const resp = await callAdminForthApi({

0 commit comments

Comments
 (0)