improved warehouse module
This commit is contained in:
@@ -107,9 +107,17 @@ Vue.component('tt-table-crud', {
|
||||
const response = await axios.post(this.crudModalData.id ? window['TT_CONFIG']['UPDATE_URL'] : window['TT_CONFIG']['CREATE_URL'],
|
||||
this.crudModalData);
|
||||
if (response.data.success) {
|
||||
this.$refs.table.refreshTable();
|
||||
this.resetCrudModalData();
|
||||
this.window.notify('success', response.data.message || 'Erfolgreich gespeichert');
|
||||
if (this.crudConfig.reopenOnCreate && !this.crudModalData.id) {
|
||||
this.resetCrudModalData();
|
||||
const getByIdUrl = window['TT_CONFIG']['GET_BY_ID_URL'] || `${window['TT_CONFIG']['BASE_PATH']}/${this.crudConfig.key}/getById`;
|
||||
const getByIdResponse = await axios.get(getByIdUrl, {params: {id: response.data.id}});
|
||||
this.crudModalData = getByIdResponse.data;
|
||||
this.crudModal = true;
|
||||
} else {
|
||||
this.resetCrudModalData();
|
||||
this.$refs.table.refreshTable();
|
||||
}
|
||||
} else {
|
||||
this.window.notify('error',
|
||||
response.data.errors ? Object.values(response.data.errors).join('<br>') : response.data.message || 'Ein Fehler ist aufgetreten');
|
||||
|
||||
Reference in New Issue
Block a user