Update PermohonanController: Hapus pengolahan file dan histori setelah update permohonan
Telah dilakukan pembersihan pada kode dengan menghapus logika pengolahan file dan pembuatan histori setelah proses update permohonan. Perubahan ini diharapkan menyederhanakan fungsi update di dalam PermohonanController serta mengurangi beban pemrosesan yang tidak diperlukan.
This commit is contained in:
@@ -147,30 +147,8 @@
|
||||
if ($permohonan->status == 'revisi') {
|
||||
$validate['status'] = 'order';
|
||||
}
|
||||
|
||||
$permohonan->update($validate);
|
||||
|
||||
$afterRequest = $permohonan->fresh()->toArray();
|
||||
// Process file upload
|
||||
$file = null;
|
||||
if ($request->hasFile('attachment')) {
|
||||
$file = $request->file('attachment');
|
||||
}
|
||||
|
||||
// Get keterangan if provided
|
||||
$keterangan = $request->input('keterangan') ?? null;
|
||||
|
||||
$status =$validate['status'] ?? $permohonan->status;
|
||||
|
||||
$this->historyService->createHistory(
|
||||
$permohonan,
|
||||
$status,
|
||||
$keterangan,
|
||||
$beforeRequest,
|
||||
$afterRequest,
|
||||
$file
|
||||
);
|
||||
|
||||
return redirect()
|
||||
->route('permohonan.index')->with('success', 'Permohonan updated successfully');
|
||||
} catch (Exception $e) {
|
||||
|
||||
Reference in New Issue
Block a user