From b17b3b03118337db03b92e77e38d9b9f25dbf560 Mon Sep 17 00:00:00 2001 From: amjed-ali-k Date: Sat, 28 Oct 2023 23:16:50 +0530 Subject: [PATCH] fixed search hide issue in seating page --- .../exam/_components/NewExamForm.tsx | 90 ++++++++++--------- 1 file changed, 50 insertions(+), 40 deletions(-) diff --git a/src/app/dashboard/tools/exam-seating/exam/_components/NewExamForm.tsx b/src/app/dashboard/tools/exam-seating/exam/_components/NewExamForm.tsx index 6c27e20..ef277ca 100644 --- a/src/app/dashboard/tools/exam-seating/exam/_components/NewExamForm.tsx +++ b/src/app/dashboard/tools/exam-seating/exam/_components/NewExamForm.tsx @@ -370,26 +370,31 @@ function AddHallsSection({ No hall found. - {hallList?.map((hall) => ( - { - form.setValue("hallId", hall.id); - setOpen(false); - }} - > - {hall.name} - - - ))} + {hallList + ?.filter( + (e) => + !finalHalls.find((k) => k.id === e.id) + ) + .map((hall) => ( + { + form.setValue("hallId", hall.id); + setOpen(false); + }} + > + {hall.name} + + + ))} @@ -596,26 +601,31 @@ function AddBatchesSection({ No batch found. - {batchList?.map((batch) => ( - { - form.setValue("batchId", batch.id); - setOpen(false); - }} - > - {batch.name} - - - ))} + {batchList + ?.filter( + (e) => + !finalBatches.find((k) => k.id === e.id) + ) + .map((batch) => ( + { + form.setValue("batchId", batch.id); + setOpen(false); + }} + > + {batch.name} + + + ))}