Skip to content

Commit

Permalink
Fixed issue krayin#1821
Browse files Browse the repository at this point in the history
  • Loading branch information
amit-webkul committed Dec 27, 2024
1 parent 1f90616 commit 5a1b725
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public function update(AttributeForm $request, int $id): RedirectResponse|JsonRe

if (request()->ajax()) {
return response()->json([
'data' => $person,
'message' => trans('admin::app.contacts.persons.index.update-success'),
], 200);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public function update(AttributeForm $request, int $id): RedirectResponse|JsonRe

if (request()->ajax()) {
return response()->json([
'data' => $warehouse,
'message' => trans('admin::app.settings.warehouses.index.update-success'),
]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,17 +289,24 @@ class="primary-button justify-center"
this.inputValue = params.contact_emails;
if (this.url) {
this.isProcessing = true;
this.$axios.put(this.url, {
[this.name]: this.inputValue,
})
.then((response) => {
this.emails = response.data.data.emails || this.emails;
this.$emitter.emit('add-flash', { type: 'success', message: response.data.message });
})
.catch((error) => {
this.inputValue = this.value;
this.$emitter.emit('add-flash', { type: 'error', message: error.response.data.message });
});
})
.finally(() => {
this.isProcessing = false;
});
}
this.$emit('on-save', params);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,20 +287,27 @@ class="primary-button justify-center"
},
updateOrCreate(params) {
this.inputValue = params.contact_numbers;
this.inputValue = params.contact_numbers || this.inputValue;
if (this.url) {
this.isProcessing = true;
this.$axios.put(this.url, {
[this.name]: this.inputValue,
})
.then((response) => {
this.contactNumbers = response.data.data.contact_numbers || this.contactNumbers;
this.$emitter.emit('add-flash', { type: 'success', message: response.data.message });
})
.catch((error) => {
this.inputValue = this.value;
this.$emitter.emit('add-flash', { type: 'error', message: error.response.data.message });
});
})
.finally(() => {
this.isProcessing = false;
});
}
this.$emit('on-save', params);
Expand Down

0 comments on commit 5a1b725

Please sign in to comment.