diff --git a/modules/core/src/web/lib/data-source/axios/create-axios-data-source.ts b/modules/core/src/web/lib/data-source/axios/create-axios-data-source.ts index ece0b7ab..0345bc64 100644 --- a/modules/core/src/web/lib/data-source/axios/create-axios-data-source.ts +++ b/modules/core/src/web/lib/data-source/axios/create-axios-data-source.ts @@ -41,9 +41,15 @@ export const createAxiosDataSource = (client: AxiosInstance): IDataSource => { return { getBaseUrl: () => (client as AxiosInstance).getUri(), - getList: async (resource: string, params?: Record) => { - const res = await (client as AxiosInstance).get(resource, params); - return res.data; + getList: async (resource: string, params?: Record): Promise => { + const { pagination } = params as any; + + const res = await (client as AxiosInstance).get(resource, { + params: { + ...pagination, + }, + }); + return res.data; }, getOne: async (resource: string, id: string | number) => { @@ -51,9 +57,9 @@ export const createAxiosDataSource = (client: AxiosInstance): IDataSource => { return res.data; }, - getMany: async (resource: string, ids: Array) => { + getMany: async (resource: string, ids: Array): Promise => { const res = await (client as AxiosInstance).get(`${resource}`, { params: { ids } }); - return res.data; + return res.data; }, createOne: async (resource: string, data: Partial) => { diff --git a/modules/core/src/web/lib/data-source/datasource.interface.ts b/modules/core/src/web/lib/data-source/datasource.interface.ts index d0a3f3fc..e76f025e 100644 --- a/modules/core/src/web/lib/data-source/datasource.interface.ts +++ b/modules/core/src/web/lib/data-source/datasource.interface.ts @@ -14,9 +14,9 @@ export interface ICustomParams { export interface IDataSource { getBaseUrl(): string; - getList(resource: string, params?: Record): Promise; + getList(resource: string, params?: Record): Promise; getOne(resource: string, id: string | number): Promise; - getMany(resource: string, ids: Array): Promise; + getMany(resource: string, ids: Array): Promise; createOne(resource: string, data: Partial): Promise; updateOne(resource: string, id: string | number, data: Partial): Promise; deleteOne(resource: string, id: string | number): Promise; diff --git a/modules/customer-invoices/src/web/components/customer-invoices-list-grid.tsx b/modules/customer-invoices/src/web/components/customer-invoices-list-grid.tsx index bf99df61..05cee80a 100644 --- a/modules/customer-invoices/src/web/components/customer-invoices-list-grid.tsx +++ b/modules/customer-invoices/src/web/components/customer-invoices-list-grid.tsx @@ -18,7 +18,11 @@ import { CustomerInvoiceStatusBadge } from "./customer-invoice-status-badge"; // Create new GridExample component export const CustomerInvoicesListGrid = () => { const { t } = useTranslation(); - const { data, isLoading, isPending, isError, error } = useCustomerInvoicesQuery({}); + const { data, isLoading, isPending, isError, error } = useCustomerInvoicesQuery({ + pagination: { + pageSize: 9999, + }, + }); // Column Definitions: Defines & controls grid columns. const [colDefs] = useState([ @@ -75,6 +79,7 @@ export const CustomerInvoicesListGrid = () => { ]); const gridOptions: GridOptions = { + rowModelType: "clientSide", columnDefs: colDefs, defaultColDef: { editable: false, diff --git a/modules/customer-invoices/src/web/hooks/use-customer-invoices-query.tsx b/modules/customer-invoices/src/web/hooks/use-customer-invoices-query.tsx index cc91ed1a..9e2b0c76 100644 --- a/modules/customer-invoices/src/web/hooks/use-customer-invoices-query.tsx +++ b/modules/customer-invoices/src/web/hooks/use-customer-invoices-query.tsx @@ -11,6 +11,7 @@ export const useCustomerInvoicesQuery = (params: any) => { queryKey: keys().data().resource("customer-invoices").action("list").params(params).get(), queryFn: (context) => { console.log(dataSource.getBaseUrl()); + console.log(params); const { signal } = context; return dataSource.getList("customer-invoices", { signal,