mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-16 01:56:24 +00:00
fixed edit community
This commit is contained in:
@ -5,7 +5,7 @@ class CommunityModel {
|
||||
final String uuid;
|
||||
final DateTime createdAt;
|
||||
final DateTime updatedAt;
|
||||
final String name;
|
||||
String name;
|
||||
final String description;
|
||||
final RegionModel? region;
|
||||
List<SpaceModel> spaces;
|
||||
@ -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