From 80eebc50d0b6347eae3fcab3b69aa632d1ed497d Mon Sep 17 00:00:00 2001 From: zadit biasa aja <75159257+everythingonblack@users.noreply.github.com> Date: Sat, 5 Jul 2025 12:01:34 +0000 Subject: [PATCH] ok --- src/FileListComponent.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/FileListComponent.js b/src/FileListComponent.js index 0543935..322c70d 100644 --- a/src/FileListComponent.js +++ b/src/FileListComponent.js @@ -60,17 +60,17 @@ const FileListComponent = () => { const data = JSON.parse(text); + console.log(data); if (data.error) { alert(data.error); return; } - // Validasi URL gambar (opsional) if (data.foto_url && !data.foto_url.match(/\.(jpg|jpeg|png)$/i)) { console.warn("URL foto bukan format gambar yang didukung."); } - setSelectedFile(data); + setSelectedFile(data[0]); } catch (error) { console.error("Gagal mengambil detail:", error.message || error); alert("Gagal mengambil detail. Pastikan data tersedia."); @@ -152,9 +152,9 @@ const FileListComponent = () => { onClick={(e) => e.stopPropagation()} > {/* Foto KTP */} - {selectedFile.foto_url && ( + {selectedFile.data && (