From 3b9bd3c5bd4d34959dd1d4894291804d03f418e3 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Mon, 9 Mar 2026 03:50:33 +0700 Subject: [PATCH] Revert "refactor(FE): Prevent adding recordings for kandangs in transition" This reverts commit 9dc30c1f5862d0bb0c20171e9bcee69e8a66dba2. --- .../recording/form/RecordingForm.tsx | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/src/components/pages/production/recording/form/RecordingForm.tsx b/src/components/pages/production/recording/form/RecordingForm.tsx index de3a3565..94676f43 100644 --- a/src/components/pages/production/recording/form/RecordingForm.tsx +++ b/src/components/pages/production/recording/form/RecordingForm.tsx @@ -678,31 +678,10 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => { .filter((pfk) => pfk.project_flock_id === selectedProjectFlock.value) .map((pfk) => pfk.kandang_id); - const kandangIdsInTransition = new Set(); - if (isResponseSuccess(existingRecordings) && type === 'add') { - existingRecordings.data.forEach((recording: Recording) => { - if (recording.project_flock?.project_flock_category === 'GROWING') { - const pfKandangId = - recording.project_flock?.project_flock_kandang_id; - if (pfKandangId) { - if ( - recording.transfer_executed || - !recording.population_can_change - ) { - kandangIdsInTransition.add(pfKandangId); - } - } - } - }); - } - const kandangOptions = selectedProjectFlockData.kandangs .filter((kandang: Kandang) => { if (type === 'add') { - return ( - approvedKandangIds.includes(kandang.id) && - !kandangIdsInTransition.has(kandang.id) - ); + return approvedKandangIds.includes(kandang.id); } return true; }) @@ -734,7 +713,6 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => { projectFlockKandangDetail, type, approvedProjectFlockKandangs, - existingRecordings, ]); const recordedProjectFlockKandangIds = useMemo(() => {