diff --git a/src/providers/pond/deviceAPI.tsx b/src/providers/pond/deviceAPI.tsx index 308c19f..27ea776 100644 --- a/src/providers/pond/deviceAPI.tsx +++ b/src/providers/pond/deviceAPI.tsx @@ -211,12 +211,27 @@ export default function DeviceProvider(props: PropsWithChildren) { types?: string[] ) => { let url = pondURL("/deviceStatistics"); - if (types && types.length > 0) - url = pondURL( - "/deviceStatistics/" + - (keys ? "?keys=" + keys.toString() : "") + - (types ? "&types=" + types.toString() : "") - ) + if (types && types.length > 0) { + url = pondURL( + "/deviceStatistics/" + + (keys ? "?keys=" + keys.toString() : "") + + (types ? "&types=" + types.toString() : "") + ) + if (!types.includes("team") && as.length > 0) { + url = pondURL( + "/deviceStatistics/" + + (keys ? "?keys=" + keys.toString() : "") + + (types ? "&types=" + types.toString() : "") + + ("&as=" + as) + ) + } + } else { + if (as.length > 0) { + url = pondURL( + "/deviceStatistics/?as=" + as + ) + } + } return new Promise>((resolve, reject) => { get(url).then(resp => { resp.data = pond.GetDeviceStatisticsResponse.fromObject(resp.data)