Matched the GetOccupancyHeatMapParam with what the API expects and removed the communityId since it is no longer necessary for the api, and renamed spaceId to spaceUuid for more clarity.

This commit is contained in:
Faris Armoush
2025-05-14 10:49:32 +03:00
parent c1dab3400b
commit 300f9ae358
2 changed files with 4 additions and 11 deletions

View File

@ -35,8 +35,7 @@ abstract final class FetchOccupancyDataHelper {
context.read<OccupancyHeatMapBloc>().add(
LoadOccupancyHeatMapEvent(
GetOccupancyHeatMapParam(
spaceId: spaceId,
communityId: communityId,
spaceUuid: spaceId,
year: datePickerState.yearlyDate,
),
),

View File

@ -1,19 +1,13 @@
class GetOccupancyHeatMapParam {
final DateTime year;
final String communityId;
final String spaceId;
final String spaceUuid;
const GetOccupancyHeatMapParam({
required this.year,
required this.communityId,
required this.spaceId,
required this.spaceUuid,
});
Map<String, dynamic> toJson() {
return {
'year': year.toIso8601String(),
'communityId': communityId,
'spaceId': spaceId,
};
return {'year': year.year};
}
}