diff --git a/frontend/hospital-portal/src/components/Table.tsx b/frontend/hospital-portal/src/components/Table.tsx index b6f3875a..064d4c84 100755 --- a/frontend/hospital-portal/src/components/Table.tsx +++ b/frontend/hospital-portal/src/components/Table.tsx @@ -252,7 +252,6 @@ const allowedStatusesForCSLMS = ['waiting_pharmacy', 'order_prepared', 'ready', const [openDialogStatus, setOpenDialogStatus] = useState(false); // const [dialogIDRow, setDialogIDRow] = useState(null); -console.log(dialogIDRow); const [dialogIDRowDriver, setDialogIDRowDriver] = useState(null); const [txtStatusDriver, setTxtStatusDriver] = useState(''); const [txtIDDriver, setTxtIDDriver] = useState(''); @@ -272,7 +271,7 @@ console.log(dialogIDRow); const handleClickKonfirmasi = (row: any) => { setTxtStatusDriver(''); setTxtIDDriver(''); - if(row.sStatus === 'ready' || row.sStatus === 'failed') + if(row.sStatus === 'order_prepared' || row.sStatus === 'ready' || row.sStatus === 'failed') { //close setDialogIDRow(row.id === dialogIDRow ? null : row.id); @@ -314,6 +313,8 @@ console.log(dialogIDRow); } } const putPrescriptionOrders = (row: any) => { + //close + setDialogIDRow(row.id === dialogIDRow ? null : row.id); setIsDisabled(true); // Disable button after clicking const updateData = { sStatus: row.sStatus @@ -322,7 +323,6 @@ console.log(dialogIDRow); .put(`/put-prescription-orders/${row.nID_orders}`, updateData) .then((response) => { enqueueSnackbar(response?.data?.meta?.message, { variant: 'success' }); - setDialogIDRow(row.id === dialogIDRow ? null : row.id); setIsDisabled(false); // Re-enable the button after success // Call reloadData to refresh the table diff --git a/frontend/hospital-portal/src/sections/dashboardApotek/TableList.tsx b/frontend/hospital-portal/src/sections/dashboardApotek/TableList.tsx index 328c76c9..78fca2cf 100644 --- a/frontend/hospital-portal/src/sections/dashboardApotek/TableList.tsx +++ b/frontend/hospital-portal/src/sections/dashboardApotek/TableList.tsx @@ -392,8 +392,8 @@ export default function TableList() {