diff --git a/frontend/client-portal/.env.development b/frontend/client-portal/.env.development index fd08f5b0..1292c8a9 100644 --- a/frontend/client-portal/.env.development +++ b/frontend/client-portal/.env.development @@ -5,5 +5,5 @@ PORT=8083 REACT_APP_HOST_API_URL="https://aso-api.linksehat.dev/api/client" # VITE_API_URL="https://aso-api.linksehat.dev/api/client" -VITE_API_URL="https://primecenter-api.linksehat.com/api/client" +VITE_API_URL="http://localhost:8000/api/client" diff --git a/frontend/client-portal/src/components/Table.tsx b/frontend/client-portal/src/components/Table.tsx index 5ac0bad7..cb3fe38e 100644 --- a/frontend/client-portal/src/components/Table.tsx +++ b/frontend/client-portal/src/components/Table.tsx @@ -288,7 +288,11 @@ export default function Table({ {exportReport && exportReport.useExport ? ( - + ) : ( + + ), + })) + ); + setPaginationTable(membersResponse.data); + setRowsPerPage(membersResponse.data.per_page); + + if (searchParams.get('page')) { + // @ts-ignore + const currentPage = parseInt(searchParams.get('page')) - 1; + paginationTable.current_page = currentPage; + setPage(currentPage); + } + + setIsLoading(false); + } catch (error: any) { + console.error('Error fetching data:', error.message); } - - setPolicyData({ - limit: corporatePolicyLimit.data.data, - topUpLimit: corporateTopUpLimit.data.data, - }); - setDivisionData(corporateDivision.data); - setMemberData( - corporateMembers.data.data.map((obj: any) => ({ - ...obj, - // limit: ( - // - // - // - // {fSplit(obj.limit.current)} / {fSplit(obj.limit.total)} - // - // - // ), - status: - obj.status === 1 ? ( - - ) : ( - - ), - /* action: ( - - - - ), */ - })) - ); - setPaginationTable(corporateMembers.data); - setRowsPerPage(corporateMembers.data.per_page); - - if (searchParams.get('page')) { - //@ts-ignore - const currentPage = parseInt(searchParams.get('page')) - 1; - - paginationTable.current_page = currentPage; - setPage(currentPage); - } - - closeSnackbar(loadNotif); - setIsLoading(false); - enqueueSnackbar('Data sudah di load!', { - variant: 'info', - anchorOrigin: { horizontal: 'right', vertical: 'bottom' }, - }); })(); - }, [appliedParams, searchParams, order, orderBy, pathname, setSearchParams, corporateValue]); + + return () => { + controller.abort(); + }; + }, [appliedParams, searchParams, order, orderBy, setSearchParams, corporateValue]); return ( @@ -361,12 +260,6 @@ export default function Index() { - {/* - - - - - */} + + + + + + - - - - - - + + + - - - + + + - - - + + - - + Dashboard + + + + - Dashboard - - - - - - - -
- - - + + +
+ + diff --git a/frontend/hospital-portal/index.html b/frontend/hospital-portal/index.html index b84258ef..0128c552 100644 --- a/frontend/hospital-portal/index.html +++ b/frontend/hospital-portal/index.html @@ -1,36 +1,39 @@ + + + + + + - - - - - - + + + - - - + + + - - - + + - - + Dashboard + + + + - Dashboard - - - - - - - -
- - - + + +
+ + diff --git a/frontend/hospital-portal/pnpm-lock.yaml b/frontend/hospital-portal/pnpm-lock.yaml index 7fb2a7cf..6f2da469 100644 --- a/frontend/hospital-portal/pnpm-lock.yaml +++ b/frontend/hospital-portal/pnpm-lock.yaml @@ -113,6 +113,9 @@ dependencies: react-lazy-load-image-component: specifier: ^1.5.6 version: 1.5.6(react-dom@17.0.2)(react@17.0.2) + react-number-format: + specifier: ^5.3.1 + version: 5.3.1(react-dom@17.0.2)(react@17.0.2) react-quill: specifier: 2.0.0-beta.4 version: 2.0.0-beta.4(react-dom@17.0.2)(react@17.0.2) @@ -5313,6 +5316,17 @@ packages: react-dom: 17.0.2(react@17.0.2) dev: false + /react-number-format@5.3.1(react-dom@17.0.2)(react@17.0.2): + resolution: {integrity: sha512-qpYcQLauIeEhCZUZY9jXZnnroOtdy3jYaS1zQ3M1Sr6r/KMOBEIGNIb7eKT19g2N1wbYgFgvDzs19hw5TrB8XQ==} + peerDependencies: + react: ^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 + react-dom: ^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 + dependencies: + prop-types: 15.8.1 + react: 17.0.2 + react-dom: 17.0.2(react@17.0.2) + dev: false + /react-quill@2.0.0-beta.4(react-dom@17.0.2)(react@17.0.2): resolution: {integrity: sha512-KyAHvAlPjP4xLElKZJefMth91Z6FbbXRvq9OSu6xN3KBaoasLP9p+3dcxg4Ywr4tBlpMGXcPszYSAgd5CpJ45Q==} peerDependencies: