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