New Changes with Page Request
This commit is contained in:
+15
-19
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user