mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
updated device management
This commit is contained in:
@ -16,15 +16,11 @@ class CommunitySpaceManagementApi {
|
||||
List<dynamic> jsonData = json['data'];
|
||||
|
||||
// Check if jsonData is actually a List
|
||||
if (jsonData is List) {
|
||||
List<CommunityModel> communityList = jsonData.map((jsonItem) {
|
||||
return CommunityModel.fromJson(jsonItem);
|
||||
}).toList();
|
||||
return communityList;
|
||||
} else {
|
||||
throw Exception('Expected a list but got something else.');
|
||||
}
|
||||
},
|
||||
List<CommunityModel> communityList = jsonData.map((jsonItem) {
|
||||
return CommunityModel.fromJson(jsonItem);
|
||||
}).toList();
|
||||
return communityList;
|
||||
},
|
||||
);
|
||||
return response;
|
||||
} catch (e) {
|
||||
|
Reference in New Issue
Block a user