mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-11-26 19:24:54 +00:00
@ -27,12 +27,9 @@ class CommunityModel {
|
||||
updatedAt: DateTime.parse(json['updatedAt'] ?? ''),
|
||||
name: json['name'] ?? '',
|
||||
description: json['description'] ?? '',
|
||||
region:
|
||||
json['region'] != null ? RegionModel.fromJson(json['region']) : null,
|
||||
region: json['region'] != null ? RegionModel.fromJson(json['region']) : null,
|
||||
spaces: json['spaces'] != null
|
||||
? (json['spaces'] as List)
|
||||
.map((space) => SpaceModel.fromJson(space))
|
||||
.toList()
|
||||
? (json['spaces'] as List).map((space) => SpaceModel.fromJson(space)).toList()
|
||||
: [],
|
||||
);
|
||||
}
|
||||
@ -45,9 +42,7 @@ class CommunityModel {
|
||||
'name': name,
|
||||
'description': description,
|
||||
'region': region?.toJson(),
|
||||
'spaces': spaces
|
||||
.map((space) => space.toMap())
|
||||
.toList(), // Convert spaces to Map
|
||||
'spaces': spaces.map((space) => space.toMap()).toList(), // Convert spaces to Map
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user