feat: fix
This commit is contained in:
		@@ -8,5 +8,6 @@ export type GetProfitChartDataRequest = {
 | 
				
			|||||||
    baseMarketplaceKey: string;
 | 
					    baseMarketplaceKey: string;
 | 
				
			||||||
    dealStatusId: number;
 | 
					    dealStatusId: number;
 | 
				
			||||||
    managerId: number;
 | 
					    managerId: number;
 | 
				
			||||||
 | 
					    tagId: number;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,6 +9,7 @@ export type GetProfitTableDataRequest = {
 | 
				
			|||||||
    baseMarketplaceKey: string;
 | 
					    baseMarketplaceKey: string;
 | 
				
			||||||
    dealStatusId: number;
 | 
					    dealStatusId: number;
 | 
				
			||||||
    managerId: number;
 | 
					    managerId: number;
 | 
				
			||||||
 | 
					    tagId: number;
 | 
				
			||||||
    groupTableBy: ProfitTableGroupBy;
 | 
					    groupTableBy: ProfitTableGroupBy;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,11 +1,11 @@
 | 
				
			|||||||
type Props<T, C = void> = {
 | 
					type Props<T, C = T> = {
 | 
				
			||||||
    onCreate: (element: T | C) => void;
 | 
					    onCreate: (element: C) => void;
 | 
				
			||||||
    onChange: (element: T) => void;
 | 
					    onChange: (element: T) => void;
 | 
				
			||||||
    onDelete: (element: T) => void;
 | 
					    onDelete: (element: T) => void;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export function useCRUD<T, C>(props: Props<T, C>) {
 | 
					export function useCRUD<T, C = T>(props: Props<T, C>) {
 | 
				
			||||||
    const onCreate = (element: T | C) => {
 | 
					    const onCreate = (element: C) => {
 | 
				
			||||||
        props.onCreate(element);
 | 
					        props.onCreate(element);
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
    const onChange = (element: T) => {
 | 
					    const onChange = (element: T) => {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@ import { RefObject } from "react";
 | 
				
			|||||||
import { BaseTableRef } from "../components/BaseTable/BaseTable.tsx";
 | 
					import { BaseTableRef } from "../components/BaseTable/BaseTable.tsx";
 | 
				
			||||||
import { MRT_RowData } from "mantine-react-table";
 | 
					import { MRT_RowData } from "mantine-react-table";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface CRUDTableProps<T extends MRT_RowData, C = void> {
 | 
					export interface CRUDTableProps<T extends MRT_RowData, C extends MRT_RowData = T> {
 | 
				
			||||||
    items: T[];
 | 
					    items: T[];
 | 
				
			||||||
    onCreate?: (item: C | T) => void;
 | 
					    onCreate?: (item: C | T) => void;
 | 
				
			||||||
    onDelete?: (item: T) => void;
 | 
					    onDelete?: (item: T) => void;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user