Merge pull request #5138 from devansh-webkul/address-delete-issue
Fixed delete customer address from admin panel in which page is not reloading #5098
This commit is contained in:
commit
825b83992d
|
|
@ -172,9 +172,10 @@ class AddressController extends Controller
|
|||
{
|
||||
$this->customerAddressRepository->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.customers.addresses.success-delete'));
|
||||
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
return response()->json([
|
||||
'redirect' => false,
|
||||
'message' => trans('admin::app.customers.addresses.success-delete')
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"/js/ui.js": "/js/ui.js?id=5fe6e08635de7fcaa890",
|
||||
"/js/ui.js": "/js/ui.js?id=0e7531d8cbf7818a9acd",
|
||||
"/css/ui.css": "/css/ui.css?id=87c15a3e7af4ab272377"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1459,6 +1459,8 @@
|
|||
},
|
||||
|
||||
doAction: function(e, message, type) {
|
||||
let self = this;
|
||||
|
||||
let element = e.currentTarget;
|
||||
|
||||
if (message) {
|
||||
|
|
@ -1474,10 +1476,19 @@
|
|||
_method: element.getAttribute("data-method")
|
||||
})
|
||||
.then(function(response) {
|
||||
/**
|
||||
* If refirect is true, then pass redirect url in the response.
|
||||
*
|
||||
* Else, it will reload table only.
|
||||
*/
|
||||
if (response.data.redirect) {
|
||||
window.location.href = response.data.redirect;
|
||||
window.location.href = response.data.redirectUrl;
|
||||
} else {
|
||||
location.reload();
|
||||
self.hitUrl();
|
||||
|
||||
window.flashMessages.push({'type': 'alert-success', 'message': response.data.message });
|
||||
|
||||
self.$root.addFlashMessages();
|
||||
}
|
||||
})
|
||||
.catch(function(error) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue