update approval currency

This commit is contained in:
daengdeni 2024-01-17 11:16:00 +07:00
parent 1d8bed3118
commit 477c993843
2 changed files with 12 additions and 1 deletions

View File

@ -90,6 +90,7 @@
{
$_model = [
'Parameter Cabang' => 'Branch',
'Parameter Mata Uang' => 'Currency',
];
try {
$approval = Approval::findOrFail($id);

View File

@ -21,7 +21,7 @@
protected $listeners = [
'delete' => 'delete',
'update' => 'update',
'reload' => 'reload',
'reload' => 'reload',
];
public function render()
@ -46,6 +46,9 @@
// Emit a success event with a message
$currency = Currency::find($this->id);
$data['updated_by'] = auth()->user()->id;
$data['updated_at'] = now();
$approval = [
'method' => 'update',
'menu' => 'Parameter Mata Uang',
@ -70,6 +73,8 @@
$this->dispatch('success', 'Data Berhasil Di Update, Menunggu Approval');
}
} else {
$data['created_by'] = auth()->user()->id;
$data['created_at'] = now();
// Emit a success event with a message
$approval = [
'method' => 'create',
@ -115,6 +120,10 @@
public function delete($id)
{
$old = Currency::find($id);
unset($old->deleted_at);
unset($old->deleted_by);
$curency = Currency::find($id);
$curency->delete_by = auth()->user()->id;
$curency->deleted_at = now();
@ -122,6 +131,7 @@
$approval = [
'method' => 'delete',
'menu' => 'Parameter Mata uang',
'new_request' => json_encode($curency),
'old_request' => json_encode($curency),
'description' => 'Delete Parameter Mata uang',
'status' => '0',