Perbaiki validasi, logika, dan tampilan terkait dokumen jaminan

- Menambahkan validasi untuk `permohonan_id` pada `DokumenJaminanRequest`.
- Memperbaiki logika penggabungan parameter query untuk rute tertentu.
- Merapikan formatting kode pada tampilan blade, termasuk elemen HTML dan JavaScript.
- Mengatasi beberapa bug minor terkait aksi dan tampilan dokumen jaminan.
This commit is contained in:
Daeng Deni Mardaeni
2024-12-27 09:36:07 +07:00
parent 407306e085
commit 66b8a9053b
4 changed files with 88 additions and 86 deletions

View File

@@ -146,7 +146,6 @@
$debitur = Debiture::find($id); $debitur = Debiture::find($id);
$validate = $request->validated(); $validate = $request->validated();
if ($validate) { if ($validate) {
try { try {
DB::beginTransaction(); DB::beginTransaction();

View File

@@ -13,16 +13,17 @@
: array : array
{ {
$rules = [ $rules = [
'debiture_id' => 'required|exists:debitures,id', 'debiture_id' => 'required|exists:debitures,id',
'pemilik_jaminan_id' => 'required', 'permohonan_id' => 'required|exists:permohonan,id',
'jenis_jaminan_id' => 'required', 'pemilik_jaminan_id' => 'required',
'province_code' => 'nullable|exists:provinces,code', 'jenis_jaminan_id' => 'required',
'city_code' => 'nullable|exists:cities,code', 'province_code' => 'nullable|exists:provinces,code',
'district_code' => 'nullable|exists:districts,code', 'city_code' => 'nullable|exists:cities,code',
'village_code' => 'nullable|exists:villages,code', 'district_code' => 'nullable|exists:districts,code',
'address' => 'nullable|string', 'village_code' => 'nullable|exists:villages,code',
'postal_code' => 'nullable|string|max:10', 'address' => 'nullable|string',
'status' => 'nullable|boolean', 'postal_code' => 'nullable|string|max:10',
'status' => 'nullable|boolean',
]; ];
return $rules; return $rules;

View File

@@ -3,7 +3,7 @@
@method('PUT') @method('PUT')
@endif @endif
@csrf @csrf
<input type="hidden" name="permohonan_id" value="{{ $document->id ?? request()->get('permohonan_id') }}">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56"> <label class="form-label max-w-56">
Debitur Debitur
@@ -427,13 +427,13 @@
@push('scripts') @push('scripts')
{{--Pemilik Jaminan--}} {{--Pemilik Jaminan--}}
<script> <script>
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function() {
const namaSertifikatDiv = document.getElementById("nama_sertifikat"); const namaSertifikatDiv = document.getElementById("nama_sertifikat");
// Function to add delete event listeners to existing buttons // Function to add delete event listeners to existing buttons
function addDeleteListeners() { function addDeleteListeners() {
document.querySelectorAll(".delete-button").forEach(button => { document.querySelectorAll(".delete-button").forEach(button => {
button.addEventListener("click", function () { button.addEventListener("click", function() {
this.closest(".flex.items-baseline.flex-wrap.lg\\:flex-nowrap.gap-2\\.5.mb-5").remove(); this.closest(".flex.items-baseline.flex-wrap.lg\\:flex-nowrap.gap-2\\.5.mb-5").remove();
}); });
}); });
@@ -442,7 +442,7 @@
// Add delete listeners to existing buttons // Add delete listeners to existing buttons
addDeleteListeners(); addDeleteListeners();
document.getElementById("tambah_sertifikat").addEventListener("click", function () { document.getElementById("tambah_sertifikat").addEventListener("click", function() {
const newDiv = document.createElement("div"); const newDiv = document.createElement("div");
newDiv.className = "flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mb-5"; newDiv.className = "flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mb-5";
newDiv.innerHTML = ` newDiv.innerHTML = `
@@ -509,7 +509,7 @@
${index + 1}. ${item.name} ${index + 1}. ${item.name}
</label> </label>
<input type="hidden" name="jenis_legalitas_jaminan_id[]" value="${item.jenis_legalitas_jaminan_id}"> <input type="hidden" name="jenis_legalitas_jaminan_id[]" value="${item.jenis_legalitas_jaminan_id}">
${item.is_existing ? `<input type="hidden" name="detail_dokumen_jaminan_id[]" value="${item.id}">` : ''} ${item.is_existing ? `<input type="hidden" name="detail_dokumen_jaminan_id[]" value="${item.id}">` : ""}
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
@@ -517,7 +517,7 @@
Nomor Nomor
</label> </label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input class="input" type="text" name="name[]" value="${item.name || ''}" placeholder="Nomor"> <input class="input" type="text" name="name[]" value="${item.name || ""}" placeholder="Nomor">
</div> </div>
</div> </div>
@@ -527,7 +527,7 @@
</label> </label>
<div class="flex flex-wrap items-baseline w-full" id="file-container-${index}"> <div class="flex flex-wrap items-baseline w-full" id="file-container-${index}">
<div class="flex flex-col w-full gap-2"> <div class="flex flex-col w-full gap-2">
${item.dokumen_jaminan ? renderExistingFiles(item.dokumen_jaminan, debiturId, item.id, item.dokumen_nomor) : ''} ${item.dokumen_jaminan ? renderExistingFiles(item.dokumen_jaminan, debiturId, item.id, item.dokumen_nomor) : ""}
</div> </div>
<div class="flex items-center gap-2 my-2 w-full"> <div class="flex items-center gap-2 my-2 w-full">
<input class="flex-1 input" type="text" name="dokumen_nomor[${index}][]" placeholder="Nomor Dokumen"> <input class="flex-1 input" type="text" name="dokumen_nomor[${index}][]" placeholder="Nomor Dokumen">
@@ -546,26 +546,26 @@
${getCustomFieldInput(item.custom_field_type, item.custom_field, item.details)} ${getCustomFieldInput(item.custom_field_type, item.custom_field, item.details)}
</div> </div>
</div> </div>
` : ''} ` : ""}
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56"> <label class="form-label max-w-56">
Keterangan Keterangan
</label> </label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<textarea class="textarea" rows="3" name="keterangan[]">${item.keterangan || ''}</textarea> <textarea class="textarea" rows="3" name="keterangan[]">${item.keterangan || ""}</textarea>
</div> </div>
</div> </div>
`; `;
}); });
}) })
.catch(error => console.error('Error:', error)); .catch(error => console.error("Error:", error));
} }
function addFileInput(index) { function addFileInput(index) {
const container = document.getElementById(`file-container-${index}`); const container = document.getElementById(`file-container-${index}`);
const newInput = document.createElement('div'); const newInput = document.createElement("div");
newInput.className = 'flex items-center gap-2 mb-2 w-full'; newInput.className = "flex items-center gap-2 mb-2 w-full";
newInput.innerHTML = ` newInput.innerHTML = `
<input class="flex-1 input" type="text" name="dokumen_nomor[${index}][]" placeholder="Nomor Dokumen"> <input class="flex-1 input" type="text" name="dokumen_nomor[${index}][]" placeholder="Nomor Dokumen">
<input class="flex-1 file-input" type="file" name="dokumen_jaminan[${index}][]" accept=".pdf,image/*"> <input class="flex-1 file-input" type="file" name="dokumen_jaminan[${index}][]" accept=".pdf,image/*">
@@ -575,60 +575,60 @@
} }
function removeFileInput(button) { function removeFileInput(button) {
button.closest('.flex.items-center.gap-2.mb-2').remove(); button.closest(".flex.items-center.gap-2.mb-2").remove();
} }
function renderExistingFiles(dokumenJaminan, debiturId, itemId, dokumenNomor) { function renderExistingFiles(dokumenJaminan, debiturId, itemId, dokumenNomor) {
if (typeof dokumenJaminan === 'string' && typeof dokumenNomor === 'string') { if (typeof dokumenJaminan === "string" && typeof dokumenNomor === "string") {
return ` return `
<div class="flex w-full lg:w-[30%]"> <div class="flex w-full lg:w-[30%]">
<span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : ${dokumenNomor}</span> <span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : ${dokumenNomor}</span>
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}" class="flex-none badge badge-sm badge-outline mt-2"> <a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}" class="flex-none badge badge-sm badge-outline mt-2">
${dokumenJaminan.split('/').pop()} ${dokumenJaminan.split("/").pop()}
<i class="ki-filled ki-cloud-download"></i> <i class="ki-filled ki-cloud-download"></i>
</a> </a>
</div> </div>
`; `;
} else if (typeof dokumenJaminan === 'string' && dokumenNomor === null) { } else if (typeof dokumenJaminan === "string" && dokumenNomor === null) {
return ` return `
<div class="flex w-full lg:w-[30%]"> <div class="flex w-full lg:w-[30%]">
<span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : --</span> <span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : --</span>
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}" class="flex-none badge badge-sm badge-outline mt-2"> <a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}" class="flex-none badge badge-sm badge-outline mt-2">
${dokumenJaminan.split('/').pop()} ${dokumenJaminan.split("/").pop()}
<i class="ki-filled ki-cloud-download"></i> <i class="ki-filled ki-cloud-download"></i>
</a> </a>
</div> </div>
`; `;
} else if (Array.isArray(dokumenJaminan) && Array.isArray(dokumenNomor)) { } else if (Array.isArray(dokumenJaminan) && Array.isArray(dokumenNomor)) {
return dokumenJaminan.map((file, index) => `<div class="flex w-full lg:w-[30%]"> return dokumenJaminan.map((file, index) => `<div class="flex w-full lg:w-[30%]">
<span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : ${dokumenNomor[index] || 'N/A'}</span> <span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : ${dokumenNomor[index] || "N/A"}</span>
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}&file=${file}" class="flex-none badge badge-sm badge-outline mt-2 mr-2"> <a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}&file=${file}" class="flex-none badge badge-sm badge-outline mt-2 mr-2">
${file.split('/').pop()} ${file.split("/").pop()}
<i class="ki-filled ki-cloud-download"></i> <i class="ki-filled ki-cloud-download"></i>
</a></div> </a></div>
`).join(''); `).join("");
} else if (Array.isArray(dokumenJaminan) && typeof dokumenNomor === 'string') { } else if (Array.isArray(dokumenJaminan) && typeof dokumenNomor === "string") {
return dokumenJaminan.map((file, index) => `<div class="flex w-full lg:w-[30%]"> return dokumenJaminan.map((file, index) => `<div class="flex w-full lg:w-[30%]">
<span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : ${dokumenNomor} || 'N/A'}</span> <span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : ${dokumenNomor} || 'N/A'}</span>
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}&file=${file}" class="flex-none badge badge-sm badge-outline mt-2 mr-2"> <a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}&file=${file}" class="flex-none badge badge-sm badge-outline mt-2 mr-2">
${file.split('/').pop()} ${file.split("/").pop()}
<i class="ki-filled ki-cloud-download"></i> <i class="ki-filled ki-cloud-download"></i>
</a></div> </a></div>
`).join(''); `).join("");
} else if (Array.isArray(dokumenJaminan) && dokumenNomor === 'null') { } else if (Array.isArray(dokumenJaminan) && dokumenNomor === "null") {
return dokumenJaminan.map((file, index) => `<div class="flex w-full lg:w-[30%]"> return dokumenJaminan.map((file, index) => `<div class="flex w-full lg:w-[30%]">
<span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : ${dokumenNomor} || 'N/A'}</span> <span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : ${dokumenNomor} || 'N/A'}</span>
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}&file=${file}" class="flex-none badge badge-sm badge-outline mt-2 mr-2"> <a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}&file=${file}" class="flex-none badge badge-sm badge-outline mt-2 mr-2">
${file.split('/').pop()} ${file.split("/").pop()}
<i class="ki-filled ki-cloud-download"></i> <i class="ki-filled ki-cloud-download"></i>
</a></div> </a></div>
`).join(''); `).join("");
} }
return dokumenNomor; return dokumenNomor;
} }
function getCustomFieldInput(type, fieldName, value) { function getCustomFieldInput(type, fieldName, value) {
value = value ? JSON.parse(value)[fieldName] || '' : ''; value = value ? JSON.parse(value)[fieldName] || "" : "";
switch (type) { switch (type) {
case "text": case "text":
return `<input class="input" type="text" name="custom_field[][${fieldName}]" value="${value}">`; return `<input class="input" type="text" name="custom_field[][${fieldName}]" value="${value}">`;

View File

@@ -24,11 +24,11 @@
<div class="menu inline-flex" data-menu="true"> <div class="menu inline-flex" data-menu="true">
<div class="flex flex-nowrap justify-center gap-1.5"> <div class="flex flex-nowrap justify-center gap-1.5">
@if(in_array(Auth::user()->roles[0]->name,['administrator','pemohon-eo'])) @if(in_array(Auth::user()->roles[0]->name,['administrator','pemohon-eo']))
<a href="{{ route('debitur.jaminan.bulk.download',['id' => $debitur->id,'jaminan' => $document->id]) }}" class="btn btn-sm btn-icon btn-dark"> <a href="{{ route('debitur.jaminan.bulk.download',['id' => $debitur->id,'jaminan' => $document->id]) }}" class="btn btn-sm btn-icon btn-dark">
<i class="ki-outline ki-cloud-download"></i> <i class="ki-outline ki-cloud-download"></i>
</a> </a>
@endif @endif
<a href="{{ route('debitur.jaminan.edit',['id' => $debitur->id,'jaminan' => $document->id]) }}" class="btn btn-sm btn-icon btn-outline btn-info"> <a href="{{ route('debitur.jaminan.edit',array_merge(request()->query(),['id' => $debitur->id,'jaminan' => $document->id])) }}" class="btn btn-sm btn-icon btn-outline btn-info">
<i class="ki-outline ki-notepad-edit"></i> <i class="ki-outline ki-notepad-edit"></i>
</a> </a>
<a onclick="deleteData({{ $document->id }})" class="delete btn btn-sm btn-icon btn-outline btn-danger"> <a onclick="deleteData({{ $document->id }})" class="delete btn btn-sm btn-icon btn-outline btn-danger">
@@ -43,7 +43,7 @@
pemilik jaminan pemilik jaminan
</span> </span>
<p class="text-2xs text-gray-600 text-right max-w-[250px]"> <p class="text-2xs text-gray-600 text-right max-w-[250px]">
{{ $document->pemilik->name }} {{ $document->pemilik->name }}
</p> </p>
</div> </div>
<div class="border-t border-gray-300 border-dashed"> <div class="border-t border-gray-300 border-dashed">
@@ -77,14 +77,14 @@
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor)) ? json_decode($detail->dokumen_nomor) : ($detail->dokumen_nomor ? [$detail->dokumen_nomor] : []); $dokumen_nomor = is_array(json_decode($detail->dokumen_nomor)) ? json_decode($detail->dokumen_nomor) : ($detail->dokumen_nomor ? [$detail->dokumen_nomor] : []);
@endphp @endphp
@foreach($dokumen_jaminan as $index => $dokumen) @foreach($dokumen_jaminan as $index => $dokumen)
@if(in_array(Auth::user()->roles[0]->name,['administrator','pemohon-eo'])) @if(in_array(Auth::user()->roles[0]->name,['administrator','pemohon-eo']))
<a href="{{ route('debitur.jaminan.download', ['id' => $debitur->id, 'dokumen' => $detail->id, 'index' => $index]) }}" <a href="{{ route('debitur.jaminan.download', ['id' => $debitur->id, 'dokumen' => $detail->id, 'index' => $index]) }}"
class="flex-none badge badge-sm badge-outline mt-2 mr-2"> class="flex-none badge badge-sm badge-outline mt-2 mr-2">
{{ basename($dokumen) }} {{ basename($dokumen) }}
<i class="ki-filled ki-cloud-download"></i> <i class="ki-filled ki-cloud-download"></i>
</a> </a>
@endif @endif
<span class="badge badge-sm badge-outline badge-warning mt-2" onclick="viewPDF('{{ Storage::url($dokumen_jaminan[$index]) }}')"><i class="ki-filled ki-eye mr-2"></i>Preview</span> <span class="badge badge-sm badge-outline badge-warning mt-2" onclick="viewPDF('{{ Storage::url($dokumen_jaminan[$index]) }}')"><i class="ki-filled ki-eye mr-2"></i>Preview</span>
<br> <br>
@endforeach @endforeach
@endif @endif
@@ -115,38 +115,40 @@
background-image: url('/assets/media/images/2600x1200/bg-4-dark.png'); background-image: url('/assets/media/images/2600x1200/bg-4-dark.png');
} }
</style> </style>
<a class="card border-2 border-dashed border-brand-clarity bg-center bg-[length:600px] bg-no-repeat add-new-bg" href="{{ route('debitur.jaminan.create',$debitur->id) }}"> @if(request()->get('permohonan_id'))
<div class="card-body grid items-center"> <a class="card border-2 border-dashed border-brand-clarity bg-center bg-[length:600px] bg-no-repeat add-new-bg" href="{{ route('debitur.jaminan.create',array_merge(request()->query(),['id'=>$debitur->id])) }}">
<div class="flex flex-col gap-3"> <div class="card-body grid items-center">
<div class="flex justify-center pt-5"> <div class="flex flex-col gap-3">
<div class="relative size-[60px] shrink-0"> <div class="flex justify-center pt-5">
<svg class="w-full h-full stroke-brand-clarity fill-light" fill="none" height="48" viewBox="0 0 44 48" width="44" xmlns="http://www.w3.org/2000/svg"> <div class="relative size-[60px] shrink-0">
<path d="M16 2.4641C19.7128 0.320509 24.2872 0.320508 28 2.4641L37.6506 8.0359C41.3634 10.1795 43.6506 14.141 43.6506 <svg class="w-full h-full stroke-brand-clarity fill-light" fill="none" height="48" viewBox="0 0 44 48" width="44" xmlns="http://www.w3.org/2000/svg">
<path d="M16 2.4641C19.7128 0.320509 24.2872 0.320508 28 2.4641L37.6506 8.0359C41.3634 10.1795 43.6506 14.141 43.6506
18.4282V29.5718C43.6506 33.859 41.3634 37.8205 37.6506 39.9641L28 45.5359C24.2872 47.6795 19.7128 47.6795 16 45.5359L6.34937 18.4282V29.5718C43.6506 33.859 41.3634 37.8205 37.6506 39.9641L28 45.5359C24.2872 47.6795 19.7128 47.6795 16 45.5359L6.34937
39.9641C2.63655 37.8205 0.349365 33.859 0.349365 29.5718V18.4282C0.349365 14.141 2.63655 10.1795 6.34937 8.0359L16 2.4641Z" fill=""> 39.9641C2.63655 37.8205 0.349365 33.859 0.349365 29.5718V18.4282C0.349365 14.141 2.63655 10.1795 6.34937 8.0359L16 2.4641Z" fill="">
</path> </path>
<path d="M16.25 2.89711C19.8081 0.842838 24.1919 0.842837 27.75 2.89711L37.4006 8.46891C40.9587 10.5232 43.1506 14.3196 43.1506 <path d="M16.25 2.89711C19.8081 0.842838 24.1919 0.842837 27.75 2.89711L37.4006 8.46891C40.9587 10.5232 43.1506 14.3196 43.1506
18.4282V29.5718C43.1506 33.6804 40.9587 37.4768 37.4006 39.5311L27.75 45.1029C24.1919 47.1572 19.8081 47.1572 16.25 45.1029L6.59937 18.4282V29.5718C43.1506 33.6804 40.9587 37.4768 37.4006 39.5311L27.75 45.1029C24.1919 47.1572 19.8081 47.1572 16.25 45.1029L6.59937
39.5311C3.04125 37.4768 0.849365 33.6803 0.849365 29.5718V18.4282C0.849365 14.3196 3.04125 10.5232 6.59937 8.46891L16.25 2.89711Z" stroke=""> 39.5311C3.04125 37.4768 0.849365 33.6803 0.849365 29.5718V18.4282C0.849365 14.3196 3.04125 10.5232 6.59937 8.46891L16.25 2.89711Z" stroke="">
</path> </path>
</svg> </svg>
<div class="absolute leading-none left-2/4 top-2/4 -translate-y-2/4 -translate-x-2/4"> <div class="absolute leading-none left-2/4 top-2/4 -translate-y-2/4 -translate-x-2/4">
<i class="ki-filled ki-additem text-2xl text-brand"> <i class="ki-filled ki-additem text-2xl text-brand">
</i> </i>
</div>
</div> </div>
</div> </div>
</div> <div class="flex flex-col text-center">
<div class="flex flex-col text-center"> <span class="text-lg font-semibold text-gray-900 hover:text-primary-active mb-px">
<span class="text-lg font-semibold text-gray-900 hover:text-primary-active mb-px"> Data Jaminan
Data Jaminan </span>
</span> <span class="text-2sm font-normal text-gray-600">
<span class="text-2sm font-normal text-gray-600"> Tambah Pemilik dan Dokumen Jaminan
Tambah Pemilik dan Dokumen Jaminan </span>
</span> </div>
</div> </div>
</div> </div>
</div> </a>
</a> @endif
</div> </div>
@include('lpj::component.pdfviewer') @include('lpj::component.pdfviewer')
@@ -155,33 +157,33 @@
<script type="text/javascript"> <script type="text/javascript">
function deleteData(data) { function deleteData(data) {
Swal.fire({ Swal.fire({
title: 'Are you sure?', title: "Are you sure?",
text: "You won't be able to revert this!", text: "You won't be able to revert this!",
icon: 'warning', icon: "warning",
showCancelButton: true, showCancelButton: true,
confirmButtonColor: '#3085d6', confirmButtonColor: "#3085d6",
cancelButtonColor: '#d33', cancelButtonColor: "#d33",
confirmButtonText: 'Yes, delete it!' confirmButtonText: "Yes, delete it!"
}).then((result) => { }).then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
$.ajaxSetup({ $.ajaxSetup({
headers: { headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}' "X-CSRF-TOKEN": '{{ csrf_token() }}'
} }
}); });
$.ajax(`debitur/{{$debitur->id}}}/jaminan/${data}`, { $.ajax(`debitur/{{$debitur->id}}}/jaminan/${data}`, {
type: 'DELETE' type: "DELETE"
}).then((response) => { }).then((response) => {
swal.fire('Deleted!', 'Document Jaminan has been deleted.', 'success').then(() => { swal.fire("Deleted!", "Document Jaminan has been deleted.", "success").then(() => {
window.location.reload(); window.location.reload();
}); });
}).catch((error) => { }).catch((error) => {
console.error('Error:', error); console.error("Error:", error);
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error'); Swal.fire("Error!", "An error occurred while deleting the file.", "error");
}); });
} }
}) });
} }
</script> </script>
@endpush @endpush