diff --git a/lib/pages/analytics/services/range_of_aqi/remote_range_of_aqi_service.dart b/lib/pages/analytics/services/range_of_aqi/remote_range_of_aqi_service.dart index 1a80ef33..642ad400 100644 --- a/lib/pages/analytics/services/range_of_aqi/remote_range_of_aqi_service.dart +++ b/lib/pages/analytics/services/range_of_aqi/remote_range_of_aqi_service.dart @@ -12,11 +12,8 @@ final class RemoteRangeOfAqiService implements RangeOfAqiService { Future> load(GetRangeOfAqiParam param) async { try { final response = await _httpService.get( - path: 'endpoint', - queryParameters: { - 'spaceUuid': param.spaceUuid, - 'date': param.date.toIso8601String(), - }, + path: '/aqi/range/space/${param.spaceUuid}', + queryParameters: {'monthDate': _formatDate(param.date)}, expectedResponseModel: (data) { final json = data as Map? ?? {}; final mappedData = json['data'] as List? ?? []; @@ -28,7 +25,11 @@ final class RemoteRangeOfAqiService implements RangeOfAqiService { ); return response; } catch (e) { - throw Exception('Failed to load energy consumption per phase: $e'); + throw Exception('Failed to load range of aqi: $e'); } } + + static String _formatDate(DateTime date) { + return '${date.year}-${date.month.toString().padLeft(2, '0')}'; + } }