fix: search stock product issue correctly

This commit is contained in:
ValdiANS
2026-03-18 00:13:18 +07:00
parent 39cb38a23f
commit 93d4ff9339
@@ -603,10 +603,11 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
const {
options: stockProductOptions,
setInputValue: setStockProductInputValue,
rawData: stockProducts,
isLoadingOptions: isLoadingStockProducts,
loadMore: loadMoreStockProducts,
} = useSelect(ProductWarehouseApi.basePath, 'id', 'product.name', '', {
} = useSelect(ProductWarehouseApi.basePath, 'id', 'product.name', 'search', {
flags: 'PAKAN,OVK',
location_id: stockProductsLocationId,
kandang_id: stockProductsKandangId,
@@ -2665,6 +2666,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
product.value === stock.product_warehouse_id
) || null
}
onInputChange={setStockProductInputValue}
onChange={(selectedOption) => {
const option =
selectedOption as OptionType | null;