From 455d6032482c88eb504093826e33752a1c15683d Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Wed, 19 Nov 2025 18:07:57 +0800 Subject: [PATCH] Updated assessor page --- src/pages/AssessorPage/Assessor.tsx | 43 ++++++++++++++--------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/src/pages/AssessorPage/Assessor.tsx b/src/pages/AssessorPage/Assessor.tsx index 2e1ea32..b0575f8 100644 --- a/src/pages/AssessorPage/Assessor.tsx +++ b/src/pages/AssessorPage/Assessor.tsx @@ -25,8 +25,8 @@ export default () => { const [type, setType] = createSignal('') const [applicationId, setApplicationId] = createSignal(0) - const [applicationList, setApplicationList] = createSignal([]) - const [nameList, setNameList] = createSignal([]) + // const [applicationList, setApplicationList] = createSignal([]) + // const [nameList, setNameList] = createSignal([]) const [applicationListElectrical, setApplicationListElectrical] = createSignal([]) const [nameListElectrical, setNameListElectrical] = createSignal([]) @@ -218,12 +218,12 @@ export default () => { setApplicationListOccupancy(filteredApplications) setNameListOccupancy(filteredNames) } else { - setApplicationlistBuilding(filteredApplications) + setApplicationListBuilding(filteredApplications) setNameListBuilding(filteredNames) } return } - + if (division === 'electrical') { setApplicationListElectrical(response.result) setNameListElectrical(response.result2) @@ -234,7 +234,6 @@ export default () => { setApplicationListBuilding(response.result) setNameListBuilding(response.result2) } - } catch (error) { console.error(error) } @@ -410,17 +409,17 @@ export default () => { } }) - // createEffect(async () => { - // if (filter() !== '') { - // if (isBuilding()) await getListForPrinting('building') - // if (isOccupancy()) await getListForPrinting('occupancy') - // if (isElectrical()) await getListForPrinting('electrical') - // } else if (filter() === '') { - // if (isBuilding()) await getListForPrinting('building') - // if (isOccupancy()) await getListForPrinting('occupancy') - // if (isElectrical()) await getListForPrinting('electrical') - // } - // }) + createEffect(async () => { + if (filter() !== '') { + if (isBuilding()) await getListForPrinting('building') + if (isOccupancy()) await getListForPrinting('occupancy') + if (isElectrical()) await getListForPrinting('electrical') + } else if (filter() === '') { + if (isBuilding()) await getListForPrinting('building') + if (isOccupancy()) await getListForPrinting('occupancy') + if (isElectrical()) await getListForPrinting('electrical') + } + }) return ( <> @@ -497,7 +496,7 @@ export default () => { {applicationListBuilding().map((item: string, index: number) => ( {item} - {nameList()[index]} + {nameListBuilding()[index]} {