implement sorting

This commit is contained in:
Alex Holliday
2024-09-18 10:39:47 +08:00
parent 7e1a5b6ec8
commit 2d2b101eb7
3 changed files with 23 additions and 3 deletions

View File

@@ -151,7 +151,10 @@ const MonitorTable = ({ isAdmin }) => {
"desc",
true,
page,
rowsPerPage
rowsPerPage,
null,
"createdAt",
"desc"
);
setMonitors(res?.data?.data?.monitors ?? []);
setMonitorCount(res?.data?.data?.monitorCount ?? 0);

View File

@@ -101,7 +101,10 @@ class NetworkService {
checkOrder,
normalize,
page,
rowsPerPage
rowsPerPage,
filter,
field,
order
) {
const params = new URLSearchParams();
@@ -116,6 +119,9 @@ class NetworkService {
if (normalize) params.append("normalize", normalize);
if (page) params.append("page", page);
if (rowsPerPage) params.append("rowsPerPage", rowsPerPage);
if (filter) params.append("filter", filter);
if (field) params.append("field", field);
if (order) params.append("order", order);
return this.axiosInstance.get(
`/monitors/team/${teamId}?${params.toString()}`,