From 6f6f54571f8b57901b9c2e48fa5585f11e6fc7a3 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Thu, 26 Feb 2026 16:20:00 +0700 Subject: [PATCH] refactor(FE): Reset transaction subtype when product changes for RECORDING --- .../inventory/adjustment/form/InventoryAdjustmentForm.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/pages/inventory/adjustment/form/InventoryAdjustmentForm.tsx b/src/components/pages/inventory/adjustment/form/InventoryAdjustmentForm.tsx index 19738b00..faa73a3a 100644 --- a/src/components/pages/inventory/adjustment/form/InventoryAdjustmentForm.tsx +++ b/src/components/pages/inventory/adjustment/form/InventoryAdjustmentForm.tsx @@ -372,6 +372,13 @@ const InventoryAdjustmentForm = ({ } }, [selectedTransactionSubtype]); + useEffect(() => { + if (selectedTransactionType?.value === 'RECORDING' && selectedProduct) { + setSelectedTransactionSubtype(null); + formik.setFieldValue('transaction_subtype', ''); + } + }, [selectedProduct, selectedTransactionType]); + // ===== EVENT HANDLERS ===== const locationChangeHandler = (val: OptionType | OptionType[] | null) => { const location = val as OptionType | null;