From 886eef4c0d3aacff256d8466a456b5c638c558ab Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 27 Nov 2024 15:44:36 +0300 Subject: [PATCH] feat: fix --- src/client/models/GetProfitChartDataRequest.ts | 1 + src/client/models/GetProfitTableDataRequest.ts | 1 + src/hooks/useCRUD.tsx | 8 ++++---- src/types/CRUDTable.tsx | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/client/models/GetProfitChartDataRequest.ts b/src/client/models/GetProfitChartDataRequest.ts index 765301c..00e3bd1 100644 --- a/src/client/models/GetProfitChartDataRequest.ts +++ b/src/client/models/GetProfitChartDataRequest.ts @@ -8,5 +8,6 @@ export type GetProfitChartDataRequest = { baseMarketplaceKey: string; dealStatusId: number; managerId: number; + tagId: number; }; diff --git a/src/client/models/GetProfitTableDataRequest.ts b/src/client/models/GetProfitTableDataRequest.ts index f5dd66b..9c141ff 100644 --- a/src/client/models/GetProfitTableDataRequest.ts +++ b/src/client/models/GetProfitTableDataRequest.ts @@ -9,6 +9,7 @@ export type GetProfitTableDataRequest = { baseMarketplaceKey: string; dealStatusId: number; managerId: number; + tagId: number; groupTableBy: ProfitTableGroupBy; }; diff --git a/src/hooks/useCRUD.tsx b/src/hooks/useCRUD.tsx index 715a475..9ea6b4b 100644 --- a/src/hooks/useCRUD.tsx +++ b/src/hooks/useCRUD.tsx @@ -1,11 +1,11 @@ -type Props = { - onCreate: (element: T | C) => void; +type Props = { + onCreate: (element: C) => void; onChange: (element: T) => void; onDelete: (element: T) => void; }; -export function useCRUD(props: Props) { - const onCreate = (element: T | C) => { +export function useCRUD(props: Props) { + const onCreate = (element: C) => { props.onCreate(element); }; const onChange = (element: T) => { diff --git a/src/types/CRUDTable.tsx b/src/types/CRUDTable.tsx index 65ce634..851d760 100644 --- a/src/types/CRUDTable.tsx +++ b/src/types/CRUDTable.tsx @@ -2,7 +2,7 @@ import { RefObject } from "react"; import { BaseTableRef } from "../components/BaseTable/BaseTable.tsx"; import { MRT_RowData } from "mantine-react-table"; -export interface CRUDTableProps { +export interface CRUDTableProps { items: T[]; onCreate?: (item: C | T) => void; onDelete?: (item: T) => void;