Summary Report API

This commit is contained in:
Rizqika 2024-12-31 17:11:04 +07:00
parent e8cde416a5
commit 7996568d74
2 changed files with 22 additions and 9 deletions

@ -1 +1 @@
Subproject commit b7bb5e81c38e443cca46785e23e8785f3a2cb3f5 Subproject commit addaac2b9a73b75761c7449341ecc23bfbe63cc2

View File

@ -13,15 +13,28 @@ const Summary = () => {
const [endDate, setEndDate] = useState(''); const [endDate, setEndDate] = useState('');
const [application, setApplication] = useState(''); const [application, setApplication] = useState('');
const [isMobile, setIsMobile] = useState(false); const [isMobile, setIsMobile] = useState(false);
const [menuData, setMenuData] = useState([]);
const menuData = [ useEffect(() => {
{ id: 1, value: '150', label: 'Total Transaction', icon: Transaction }, fetch('http://127.0.0.1:8000/trx_face/report-summary')
{ id: 2, value: '4', label: 'Total Enroll', icon: Enroll }, .then(response => response.json())
{ id: 3, value: '65', label: 'Total Verify', icon: Verify }, .then(data => {
{ id: 6, value: '900', label: 'Total Compare', icon: Compare }, if (data.status_code === 200) {
{ id: 4, value: '22', label: 'Total Search', icon: Search }, const summaryData = data.details.details.data;
{ id: 5, value: '23', label: 'Total Liveness', icon: Liveness }, 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 = () => { const handleApply = () => {
console.log({ startDate, endDate, application }); console.log({ startDate, endDate, application });