add mutate on row actions
This commit is contained in:
@@ -21,6 +21,7 @@ const DataTable_Main = (props) => {
|
||||
initialStateProps,
|
||||
TableToolbar,
|
||||
table_title,
|
||||
RowActions,
|
||||
} = props;
|
||||
const flatColumns = flattenArrayOfObjects(columns, "columns");
|
||||
const [pagination, setPagination] = useState({ pageIndex: 0, pageSize: 10 });
|
||||
@@ -106,11 +107,8 @@ const DataTable_Main = (props) => {
|
||||
manualSorting: true,
|
||||
onPaginationChange: setPagination,
|
||||
onSortingChange: onSortingChange,
|
||||
renderTopToolbarCustomActions: ({ table }) => (
|
||||
<>
|
||||
{TableToolbar && <TableToolbar mutate={mutate} />}
|
||||
</>
|
||||
),
|
||||
renderTopToolbarCustomActions: ({ table }) => <>{TableToolbar && <TableToolbar mutate={mutate} />}</>,
|
||||
renderRowActions: ({ row }) => <RowActions row={row} mutate={mutate} />,
|
||||
...props,
|
||||
});
|
||||
|
||||
|
||||
@@ -3,11 +3,6 @@ import { useAuth } from "@/lib/contexts/auth";
|
||||
|
||||
const DataTableWithAuth = (props) => {
|
||||
const { user } = useAuth();
|
||||
return (
|
||||
<DataTable
|
||||
user_id={user.username}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
return <DataTable user_id={user.username} {...props} />;
|
||||
};
|
||||
export default DataTableWithAuth;
|
||||
|
||||
Reference in New Issue
Block a user