diff --git a/app/Http/Controllers/DocumentController.php b/app/Http/Controllers/DocumentController.php index 67b31eb..f724b8f 100644 --- a/app/Http/Controllers/DocumentController.php +++ b/app/Http/Controllers/DocumentController.php @@ -243,9 +243,9 @@ class DocumentController extends Controller 'penerbit' => $document->publisher, 'tipe' => $document->type == Document::TYPE_TETAP ? 'Tetap' : 'Tidak Tetap', 'tanggal terbit' => $document->publish_date->format('d-m-Y'), - 'tanggal jatuh tempo' => $document->due_date->format('d-m-Y'), + 'tanggal jatuh tempo' => $document->due_date?->format('d-m-Y'), 'keterangan' => $document->description, - 'file' => asset('documents/'.$document->document), + 'file' => $document->document != null ? asset('documents/'.$document->document) : null, 'status' => $document->status == Document::STATUS_YES ? 'Ya' : 'Tidak', 'catatan' => $document->due_status, ]); diff --git a/resources/js/Pages/Document/Detail.jsx b/resources/js/Pages/Document/Detail.jsx index 345cbe8..f4a6447 100644 --- a/resources/js/Pages/Document/Detail.jsx +++ b/resources/js/Pages/Document/Detail.jsx @@ -140,17 +140,19 @@ export default function FormDocument(props) { readOnly={true} /> -
- - -
+ {doc.due_date !== null && ( +
+ + +
+ )}
{{ $collec["tanggal jatuh tempo"] }} {{ $collec["keterangan"] }} + @if($collec["file"] != null) Download + @else + Belum ada file + @endif {{ $collec["status"] }} {{ $collec["catatan"] }}