refactor(FE): Exclude falsy product_id in product filter

This commit is contained in:
rstubryan
2026-01-23 16:13:36 +07:00
parent df875eda1d
commit 5c286128e4
@@ -731,7 +731,9 @@ const MovementForm = ({ type = 'add', initialValues }: MovementFormProps) => {
(currentIdx: number) => {
const selectedProductIds =
formik.values.products
?.filter((p, idx) => idx !== currentIdx && p.product_id !== 0)
?.filter((p, idx) => {
return idx !== currentIdx && p.product_id && p.product_id !== 0;
})
.map((p) => p.product_id) || [];
return productWarehouseOptions.filter(