diff --git a/src/components/pages/inventory/movement/MovementTable.tsx b/src/components/pages/inventory/movement/MovementTable.tsx index 8ff39e3d..35625883 100644 --- a/src/components/pages/inventory/movement/MovementTable.tsx +++ b/src/components/pages/inventory/movement/MovementTable.tsx @@ -9,12 +9,10 @@ import { Icon } from '@iconify/react'; import { Movement } from '@/types/api/inventory/movement'; import { MovementApi } from '@/services/api/inventory'; import { cn } from '@/lib/helper'; -import { Product } from '@/types/api/master-data/product'; -import { Warehouse } from '@/types/api/master-data/warehouse'; import { isResponseSuccess } from '@/lib/api-helper'; import { useTableFilter } from '@/services/hooks/useTableFilter'; import { ROWS_OPTIONS } from '@/config/constant'; -import { OptionType, useSelect } from '@/components/input/SelectInput'; +import { OptionType } from '@/components/input/SelectInput'; import Button from '@/components/Button'; import DebouncedTextInput from '@/components/input/DebouncedTextInput'; import SelectInput from '@/components/input/SelectInput'; @@ -52,38 +50,15 @@ const MovementTable = () => { } = useTableFilter({ initial: { search: '', - product: '', - warehouse: '', }, paramMap: { page: 'page', pageSize: 'limit', - product: 'product_id', - warehouse: 'warehouse_id', }, }); const [sorting, setSorting] = useState([]); - const { - setInputValue: setProductInputValue, - options: productOptions, - isLoadingOptions: isLoadingProductOptions, - } = useSelect('/products', 'id', 'name'); - - const { - setInputValue: setWarehouseInputValue, - options: warehouseOptions, - isLoadingOptions: isLoadingWarehouseOptions, - } = useSelect('/warehouses', 'id', 'name'); - - const [selectedProduct, setSelectedProduct] = useState( - null - ); - const [selectedWarehouse, setSelectedWarehouse] = useState( - null - ); - const { data: movements, isLoading } = useSWR( `${MovementApi.basePath}${getTableFilterQueryString()}`, MovementApi.getAllFetcher @@ -99,16 +74,6 @@ const MovementTable = () => { setPage(1); }; - const productChangeHandler = (val: OptionType | OptionType[] | null) => { - setSelectedProduct(val as OptionType); - updateFilter('product', val ? ((val as OptionType).value as string) : ''); - }; - - const warehouseChangeHandler = (val: OptionType | OptionType[] | null) => { - setSelectedWarehouse(val as OptionType); - updateFilter('warehouse', val ? ((val as OptionType).value as string) : ''); - }; - const movementColumns: ColumnDef[] = [ { header: '#', @@ -200,33 +165,7 @@ const MovementTable = () => { /> -
- - - - +