Listing owned firms and working at firms

This commit is contained in:
2025-04-10 13:31:57 +02:00
parent cda4f5654a
commit f1ad5d2965
4 changed files with 35 additions and 23 deletions

View File

@@ -31,7 +31,8 @@ export const dataProvider: DataProvider = {
getList: async ({ resource, pagination, filters, sorters, meta }) => {
const params = new URLSearchParams();
if (pagination) {
const serverPagination = pagination && pagination.mode =="server";
if (serverPagination) {
params.append("page", String(pagination.current));
params.append("size", String(pagination.pageSize));
}
@@ -54,9 +55,15 @@ export const dataProvider: DataProvider = {
const data = await response.json();
if (serverPagination) {
return {
data: data.items,
total: data.total,
};
}
return {
data: data.items,
total: data.total, // We'll cover this in the next steps.
data: data,
total: data.length,
};
},
create: async ({ resource, variables }) => {