Fix Parameter Cabang

This commit is contained in:
Daeng Deni Mardaeni 2023-10-05 23:01:45 +07:00
parent b7588608ec
commit c1543263c4
2 changed files with 2 additions and 9 deletions

View File

@ -59,13 +59,6 @@
public function deleteBranch($id) public function deleteBranch($id)
{ {
// Prevent deletion of current user
if ($id == Auth::id()) {
$this->dispatch('error', 'Branch cannot be deleted');
return;
}
// Delete the user record with the specified ID
Branch::destroy($id); Branch::destroy($id);
// Emit a success event with a message // Emit a success event with a message

View File

@ -17,7 +17,7 @@ document.querySelectorAll('[data-kt-action="delete_row"]').forEach(function (ele
} }
}).then((result) => { }).then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
Livewire.dispatch('delete_branch', this.getAttribute('data-kt-branch-id')); Livewire.dispatch('delete_branch', { id : this.getAttribute('data-kt-branch-id') });
} }
}); });
}); });
@ -26,7 +26,7 @@ document.querySelectorAll('[data-kt-action="delete_row"]').forEach(function (ele
// Add click event listener to update buttons // Add click event listener to update buttons
document.querySelectorAll('[data-kt-action="update_row"]').forEach(function (element) { document.querySelectorAll('[data-kt-action="update_row"]').forEach(function (element) {
element.addEventListener('click', function () { element.addEventListener('click', function () {
Livewire.dispatch('update_branch', this.getAttribute('data-kt-branch-id')); Livewire.dispatch('update_branch', { id : this.getAttribute('data-kt-branch-id') });
}); });
}); });