crap
This commit is contained in:
@@ -6,7 +6,7 @@ type Props = {
|
||||
page: number,
|
||||
itemsPerPage: number,
|
||||
}
|
||||
const useServicesList = (props: Props) => {
|
||||
const useProductsList = (props: Props) => {
|
||||
const {clientId, page, itemsPerPage} = props;
|
||||
const {data, refetch} = useQuery({
|
||||
queryKey: ['getAllServices', clientId, page, itemsPerPage],
|
||||
@@ -16,4 +16,4 @@ const useServicesList = (props: Props) => {
|
||||
const paginationInfo = data?.paginationInfo;
|
||||
return {products, paginationInfo, refetch}
|
||||
}
|
||||
export default useServicesList;
|
||||
export default useProductsList;
|
||||
@@ -4,11 +4,13 @@ import styles from './ProductsPage.module.css';
|
||||
import {Button, Text, Pagination} from "@mantine/core";
|
||||
import ClientSelect from "../../../components/Selects/ClientSelect/ClientSelect.tsx";
|
||||
import ProductsTable from "../components/ProductsTable/ProductsTable.tsx";
|
||||
import useProductsList from "../hooks/useProductsList.tsx";
|
||||
import {modals} from "@mantine/modals";
|
||||
import {notifications} from "../../../shared/lib/notifications.ts";
|
||||
import {CreateProductRequest} from "../types.ts";
|
||||
import {ProductSchema, ProductService} from "../../../client";
|
||||
import ServiceSelect from "../../../components/ServiceSelect/ServiceSelect.tsx";
|
||||
import useProductsList from "../hooks/useProductsList.tsx";
|
||||
import useServicesList from "../../ServicesPage/hooks/useServicesList.tsx";
|
||||
|
||||
export const ProductsPage: FC = () => {
|
||||
const [clientId, setClientId] = useState(-1);
|
||||
@@ -79,8 +81,6 @@ export const ProductsPage: FC = () => {
|
||||
if (!paginationInfo) return;
|
||||
setTotalPages(paginationInfo.totalPages);
|
||||
}, [paginationInfo]);
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={styles['container']}>
|
||||
@@ -91,6 +91,9 @@ export const ProductsPage: FC = () => {
|
||||
onClick={() => onCreateProductClick()}
|
||||
variant={"default"}
|
||||
>Создать</Button>
|
||||
{/*<ServiceSelect*/}
|
||||
{/* value={selectedService}*/}
|
||||
{/* onChange={setSelectedService}/>*/}
|
||||
</div>
|
||||
</PageBlock>
|
||||
<PageBlock>
|
||||
|
||||
Reference in New Issue
Block a user