update module branch
This commit is contained in:
parent
0445253018
commit
3446107242
@ -21,6 +21,7 @@
|
||||
protected $listeners = [
|
||||
'delete' => 'delete',
|
||||
'update' => 'update',
|
||||
'reload' => 'reload',
|
||||
];
|
||||
|
||||
public function render()
|
||||
@ -112,17 +113,25 @@
|
||||
$this->status = $branch->status ? true : false;
|
||||
}
|
||||
|
||||
public function reload()
|
||||
{
|
||||
$this->edit_mode = false;
|
||||
$this->reset();
|
||||
}
|
||||
|
||||
public function delete($id)
|
||||
{
|
||||
|
||||
$branch = Branch::find($id);
|
||||
$old = $branch;
|
||||
$branch->delete_by = auth()->user()->id;
|
||||
$branch->deleted_at = now();
|
||||
|
||||
$approval = [
|
||||
'method' => 'delete',
|
||||
'menu' => 'Parameter Cabang',
|
||||
'old_request' => json_encode($branch),
|
||||
'old_request' => json_encode($old),
|
||||
'new_request' => json_encode($branch),
|
||||
'description' => 'Delete Parameter Cabang',
|
||||
'status' => '0',
|
||||
'ref' => $branch->kode
|
||||
|
@ -91,8 +91,12 @@
|
||||
$('#kt_modal_add_branch').modal('hide');
|
||||
LaravelDataTables['branch-table'].ajax.reload();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$('#kt_modal_add_branch').on('hidden.bs.modal', function () {
|
||||
$(this).find('form').trigger('reset');
|
||||
Livewire.dispatch('reload', false);
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user