|
|
@@ -229,7 +229,7 @@
|
|
|
<x-slot:footer>
|
|
|
<!-- Save Button -->
|
|
|
<x-admin::button
|
|
|
- button-type="button"
|
|
|
+ button-type="submit"
|
|
|
class="primary-button"
|
|
|
:title="trans('admin::app.settings.exchange-rates.index.create.save-btn')"
|
|
|
::loading="isLoading"
|
|
|
@@ -299,8 +299,13 @@
|
|
|
.catch(error => {
|
|
|
this.isLoading = false;
|
|
|
|
|
|
- if (error.response.status == 422) {
|
|
|
+ if (error.response?.status == 422) {
|
|
|
setErrors(error.response.data.errors);
|
|
|
+ } else {
|
|
|
+ this.$emitter.emit('add-flash', {
|
|
|
+ type: 'error',
|
|
|
+ message: error.response?.data?.message ?? error.message
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
},
|