diff --git a/src/components/DataTable/DataTableRowActions.tsx b/src/components/DataTable/DataTableRowActions.tsx index 1e88581..dec7533 100644 --- a/src/components/DataTable/DataTableRowActions.tsx +++ b/src/components/DataTable/DataTableRowActions.tsx @@ -13,6 +13,8 @@ import { DynamicActionComponent } from "./DynamicActionComponent"; export const DataTableRowActions = ({ row, column }) => { const actions = row.original.actions || column.columnDef.actions; + if (!actions?.length) return null; + const filteredActions = actions.filter( ({ condition_key, condition_value }) => { if (!condition_key && !condition_value) return true; @@ -21,8 +23,6 @@ export const DataTableRowActions = ({ row, column }) => { } ); - if (!actions?.length) return null; - if (filteredActions?.length === 0) return null; return ( diff --git a/tests/lib/serializeQuery.test.ts b/tests/lib/serializeQuery.test.ts index 5d0e472..58c1ff0 100644 --- a/tests/lib/serializeQuery.test.ts +++ b/tests/lib/serializeQuery.test.ts @@ -112,6 +112,7 @@ describe("Query Serialization and Deserialization", () => { // }); it("throws error for invalid input types in deserializeQuery", () => { + // @ts-ignore-next-line expect(() => deserializeQuery(null)).toThrow(); }); });