From c140b00e12876fa9ebd575c0de0214ccc3574312 Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Wed, 12 Nov 2025 18:28:32 +0800 Subject: [PATCH] Updated main page --- src/pages/MainPage/Main.tsx | 41 ++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/pages/MainPage/Main.tsx b/src/pages/MainPage/Main.tsx index ceded81..e4aeb5f 100644 --- a/src/pages/MainPage/Main.tsx +++ b/src/pages/MainPage/Main.tsx @@ -166,8 +166,8 @@ export default () => { if (division === 'electrical') { signed = await setNewStatus(division, 'ELECTRICAL ORDER OF PAYMENT APPROVED AND SIGNED', '170', 'ELECOPAPPROVEDSIGNED', 1) - const approvedid = await getIdByApplication(division, application) - updateDocflow(division, approvedid, 'FOR ELECTRICAL ORDER OF PAYMENT APPROVAL') + // const approvedid = await getIdByApplication(division, application) + updateDocflow(division, application, 'FOR ELECTRICAL ORDER OF PAYMENT APPROVAL') if (!signed) return forprinting = await setNewStatus(division, 'FOR ELECTRICAL ORDER OF PAYMENT PRINTING', '95', 'ELECOPPRINT', 0) @@ -183,8 +183,9 @@ export default () => { } } else if (division === 'occupancy') { signed = await setNewStatus(division, 'OCCUPANCY ORDER OF PAYMENT APPROVED AND SIGNED', '172', 'OCCOPAPPROVEDSIGNED', 1) - const approvedid = await getIdByApplication(division, application) - updateDocflow(division, approvedid, 'FOR OCCUPANCY RECOMMENDING APPROVAL') + // const approvedid = await getIdByApplication(division, application) + updateDocflow(division, application, 'FOR OCCUPANCY RECOMMENDING APPROVAL') + updateDocflow(division, application, 'FOR ADDITIONAL ORDER OF PAYMENT RECOMMENDING APPROVAL') if (!signed) return forprinting = await setNewStatus(division, 'APPROVED FOR PRINTING OF BUREAU OF FIRE AND ORDER OF PAYMENT', '23', 'OCORDEROFPAYMENT', 0) @@ -333,23 +334,25 @@ export default () => { await postApi('post-esigntransaction', { data: parseInt(id), data2: approvedApplication(), data3: formatedDate }) } - const updateDocflow = async (division: string, applicationid: number, status: string) => { - if (division === 'electrical') { - await postApi('update-docflow-electrical', { data: parseInt(applicationid.toString()), data2: status }) - } else if (division === 'occupancy') { - await postApi('update-docflow-occupancy', { data: parseInt(applicationid.toString()), data2: status }) - } + const updateDocflow = async (division: string, application: string, status: string) => { + // if (division === 'electrical') { + // await postApi('update-docflow-electrical', { data: parseInt(applicationid.toString()), data2: status }) + // } else if (division === 'occupancy') { + // await postApi('update-docflow-occupancy', { data: parseInt(applicationid.toString()), data2: status }) + // } + + await postApi(`update-docflow-${division}`, { data: status, data2: application }) } - const getIdByApplication = async (division: string, applicationNo: string) => { - let response - if (division === 'electrical') { - response = await getApi('get-idbyapplication-electrical', applicationNo) - } else if (division === 'occupancy') { - response = await getApi('get-idbyapplication-occupancy', applicationNo) - } - return parseInt(response) - } + // const getIdByApplication = async (division: string, applicationNo: string) => { + // let response + // if (division === 'electrical') { + // response = await getApi('get-idbyapplication-electrical', applicationNo) + // } else if (division === 'occupancy') { + // response = await getApi('get-idbyapplication-occupancy', applicationNo) + // } + // return parseInt(response) + // } const refresh = async (division: string) => { if (division === 'electrical') {