refactor networkSerivce.getMonitorsByTeamId to take a config objet

This commit is contained in:
Alex Holliday committed 2024-09-18 10:57:44 +08:00
1 parent cab023709b
commit 4748afb93a
5 files changed
+74 -58

No files matched your search

+14 -11
View File
@@ -29,17 +29,20 @@ const PageSpeed = ({ isAdmin }) => {
const fetchMonitors = async () => {
try {
setIsLoading(true);
const res = await networkService.getMonitorsByTeamId(
authToken,
user.teamId,
10,
["pagespeed"],
null,
"desc",
true,
null,
null
);
const res = await networkService.getMonitorsByTeamId({
authToken: authToken,
teamId: user.teamId,
limit: 10,
types: ["pagespeed"],
status: null,
checkOrder: "desc",
normalize: true,
page: null,
rowsPerPage: null,
filter: null,
field: null,
order: null,
});
if (res?.data?.data?.monitors) {
setMonitors(res.data.data.monitors);
}