Merge pull request #6404 from devansh-webkul/address-delete-issue

Fixed Address Delete Issue #6402
This commit is contained in:
Jitendra Singh 2022-05-06 13:36:49 +05:30 committed by GitHub
commit 1f98a663c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View File

@ -85,13 +85,13 @@
</span>
<span>
<a href="javascript:void(0);" onclick="deleteAddress('{{ __('shop::app.customer.account.address.index.confirm-delete') }}')">
<a href="javascript:void(0);" onclick="deleteAddress('{{ __('shop::app.customer.account.address.index.confirm-delete') }}', '{{ $address->id }}')">
{{ __('shop::app.customer.account.address.index.delete') }}
</a>
<form id="deleteAddressForm" action="{{ route('address.delete', $address->id) }}" method="post">
<form id="deleteAddressForm{{ $address->id }}" action="{{ route('address.delete', $address->id) }}" method="post">
@method('delete')
@csrf
</form>
</span>
@ -109,12 +109,12 @@
@push('scripts')
<script>
function deleteAddress(message) {
function deleteAddress(message, addressId) {
if (! confirm(message)) {
return;
}
$('#deleteAddressForm').submit();
$(`#deleteAddressForm${addressId}`).submit();
}
</script>
@endpush

View File

@ -52,11 +52,11 @@
{{ __('shop::app.customer.account.address.index.edit') }}
</a>
<a class="card-link" href="javascript:void(0);" onclick="deleteAddress('{{ __('shop::app.customer.account.address.index.confirm-delete') }}')">
<a class="card-link" href="javascript:void(0);" onclick="deleteAddress('{{ __('shop::app.customer.account.address.index.confirm-delete') }}', '{{ $address->id }}')">
{{ __('shop::app.customer.account.address.index.delete') }}
</a>
<form id="deleteAddressForm" action="{{ route('address.delete', $address->id) }}" method="post">
<form id="deleteAddressForm{{ $address->id }}" action="{{ route('address.delete', $address->id) }}" method="post">
@method('delete')
@csrf
@ -74,12 +74,12 @@
@push('scripts')
<script>
function deleteAddress(message) {
function deleteAddress(message, addressId) {
if (! confirm(message)) {
return;
}
$('#deleteAddressForm').submit();
$(`#deleteAddressForm${addressId}`).submit();
}
</script>
@endpush