From eac436986ca7a2c1a8d5f428e180a502775cfc31 Mon Sep 17 00:00:00 2001 From: Ajay Ghanwat Date: Thu, 13 Nov 2025 14:57:29 +0530 Subject: [PATCH] New Changes with Page Request --- src/types/table/types.ts | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/src/types/table/types.ts b/src/types/table/types.ts index 5c80071..b7435e4 100644 --- a/src/types/table/types.ts +++ b/src/types/table/types.ts @@ -38,15 +38,20 @@ export interface TableProps { rowClick?: string; } -export type ClientJoin = { +export type Sort = { + column: string; + direction: string; +} + +export type Join = { type?: "INNER" | "LEFT" | "RIGHT"; table: string; alias?: string; on: string; - selectCols?: string[]; + columns?: string[]; }; -export type ClientFilter = { +export type Filter = { column: string; operator: | "=" | "!=" | ">" | "<" | ">=" | "<=" @@ -55,35 +60,26 @@ export type ClientFilter = { | "@>" | "IS NULL" | "IS NOT NULL"; value?: unknown; - logical?: "AND" | "OR"; }; -export type ClientFetchOptions = { +export type TableFetchOptions = { table: string; alias?: string; columns: string[]; + sort: Sort[] joinSelectCols?: string[]; - joins?: ClientJoin[]; - sortable?: Record; - searchColumns?: string[]; - softDeleteCol?: string; - softDeleteOp?: "IS NULL" | "=" | "!="; - softDeleteValue?: unknown; - defaultFilters?: ClientFilter[]; + joins?: Join[]; + filters?: Filter[]; }; -export type TableRequest = { +export type TablePageRequest = { page: number; pageSize: number; - sortKey?: string; - sortOrder?: "ASC" | "DESC"; - search?: string; - filters?: ClientFilter[]; }; export type TableRequestBody = { - req: TableRequest; - opts: ClientFetchOptions; + page: TablePageRequest; + opts: TableFetchOptions; }; export interface TableResponse {