Skip to content

Commit 7563b37

Browse files
committed
Added utilities for pagination.
1 parent f3eae44 commit 7563b37

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { FolderApi } from "@lowcoder-ee/api/folderApi";
2+
import { FetchFolderElementsPaginationPayload } from "@lowcoder-ee/redux/reduxActions/folderActions";
3+
4+
export const fetchFolderElements = async (request: FetchFolderElementsPaginationPayload) => {
5+
try {
6+
const response = await FolderApi.fetchFolderElementsPagination(request);
7+
return {
8+
success: true,
9+
data: response.data.data,
10+
total:response.data.total
11+
};
12+
} catch (error) {
13+
console.error('Failed to fetch data:', error);
14+
return {
15+
success: false,
16+
error: error
17+
};
18+
}
19+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
type ApplicationType = {
2+
[key: number]: string; // This allows numeric indexing
3+
};
4+
5+
// Define the const with explicit type
6+
export const ApplicationPaginationType: ApplicationType = {
7+
0: "",
8+
1: "APPLICATION",
9+
2: "MODULE",
10+
3: "NAVLAYOUT",
11+
4: "FOLDER",
12+
6: "MOBILETABLAYOUT",
13+
7: "NAVIGATION",
14+
};

0 commit comments

Comments
 (0)