New Changes with Page Request

This commit is contained in:
2025-11-13 14:57:29 +05:30
parent e6f491aa3e
commit eac436986c
+15 -19
View File
@@ -38,15 +38,20 @@ export interface TableProps<T> {
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<string, string>;
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<T> {