diff --git a/Backend/rekan_veri_be b/Backend/rekan_veri_be index b7bb5e8..addaac2 160000 --- a/Backend/rekan_veri_be +++ b/Backend/rekan_veri_be @@ -1 +1 @@ -Subproject commit b7bb5e81c38e443cca46785e23e8785f3a2cb3f5 +Subproject commit addaac2b9a73b75761c7449341ecc23bfbe63cc2 diff --git a/src/screens/Biometric/FaceRecognition/Summary.jsx b/src/screens/Biometric/FaceRecognition/Summary.jsx index b866ffb..ff409bf 100644 --- a/src/screens/Biometric/FaceRecognition/Summary.jsx +++ b/src/screens/Biometric/FaceRecognition/Summary.jsx @@ -13,15 +13,28 @@ const Summary = () => { const [endDate, setEndDate] = useState(''); const [application, setApplication] = useState(''); const [isMobile, setIsMobile] = useState(false); + const [menuData, setMenuData] = useState([]); - const menuData = [ - { id: 1, value: '150', label: 'Total Transaction', icon: Transaction }, - { id: 2, value: '4', label: 'Total Enroll', icon: Enroll }, - { id: 3, value: '65', label: 'Total Verify', icon: Verify }, - { id: 6, value: '900', label: 'Total Compare', icon: Compare }, - { id: 4, value: '22', label: 'Total Search', icon: Search }, - { id: 5, value: '23', label: 'Total Liveness', icon: Liveness }, - ]; + useEffect(() => { + fetch('http://127.0.0.1:8000/trx_face/report-summary') + .then(response => response.json()) + .then(data => { + if (data.status_code === 200) { + const summaryData = data.details.details.data; + setMenuData([ + { id: 1, value: summaryData.totalTransaction, label: 'Total Transaction', icon: Transaction }, + { id: 2, value: summaryData.dataEnroll, label: 'Total Enroll', icon: Enroll }, + { id: 3, value: summaryData.dataVerify, label: 'Total Verify', icon: Verify }, + { id: 6, value: summaryData.dataCompare, label: 'Total Compare', icon: Compare }, + { id: 4, value: summaryData.dataSearch, label: 'Total Search', icon: Search }, + { id: 5, value: summaryData.dataLiveness, label: 'Total Liveness', icon: Liveness }, + ]); + } + }) + .catch(error => { + console.error('Error fetching summary data:', error); + }); + }, []); const handleApply = () => { console.log({ startDate, endDate, application });