mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
add asset validation
This commit is contained in:
@ -19,23 +19,26 @@ class CommunitySpaceManagementApi {
|
||||
.replaceAll('{projectId}', TempConst.projectId),
|
||||
queryParameters: {'page': page},
|
||||
expectedResponseModel: (json) {
|
||||
List<dynamic> jsonData = json['data'];
|
||||
hasNext = json['hasNext'] ?? false;
|
||||
int currentPage = json['page'] ?? 1;
|
||||
List<CommunityModel> communityList = jsonData.map((jsonItem) {
|
||||
return CommunityModel.fromJson(jsonItem);
|
||||
}).toList();
|
||||
|
||||
allCommunities.addAll(communityList);
|
||||
page = currentPage + 1;
|
||||
return communityList;
|
||||
try {
|
||||
List<dynamic> jsonData = json['data'] ?? [];
|
||||
hasNext = json['hasNext'] ?? false;
|
||||
int currentPage = json['page'] ?? 1;
|
||||
List<CommunityModel> communityList = jsonData.map((jsonItem) {
|
||||
return CommunityModel.fromJson(jsonItem);
|
||||
}).toList();
|
||||
allCommunities.addAll(communityList);
|
||||
page = currentPage + 1;
|
||||
return communityList;
|
||||
} catch (_) {
|
||||
hasNext = false;
|
||||
return [];
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
return allCommunities;
|
||||
} catch (e) {
|
||||
debugPrint('Error fetching communities: $e');
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user