removed logs

This commit is contained in:
hannathkadher
2024-10-30 12:27:31 +04:00
parent 489789da0a
commit 5c65bac076
3 changed files with 31 additions and 24 deletions

View File

@ -31,24 +31,35 @@ class SpacesAPI {
static Future<List<SubSpaceModel>> getSubSpaceBySpaceId(
String communityId, String spaceId) async {
final path = ApiEndpoints.listSubspace
.replaceFirst('{communityUuid}', communityId)
.replaceFirst('{spaceUuid}', spaceId);
print("Constructed path: $path");
try {
// Construct the API path
final path = ApiEndpoints.listSubspace
.replaceFirst('{communityUuid}', communityId)
.replaceFirst('{spaceUuid}', spaceId);
final response = await _httpService.get(
path: path,
queryParameters: {"page": 1, "pageSize": 10},
showServerMessage: false,
expectedResponseModel: (json) {
List<SubSpaceModel> rooms = [];
for (var room in json['children']) {
rooms.add(SubSpaceModel.fromJson(room));
}
return rooms;
},
);
return response;
final response = await _httpService.get(
path: path,
queryParameters: {"page": 1, "pageSize": 10},
showServerMessage: false,
expectedResponseModel: (json) {
List<SubSpaceModel> rooms = [];
if (json['data'] != null) {
for (var subspace in json['data']) {
rooms.add(SubSpaceModel.fromJson(subspace));
}
} else {
print("Warning: 'data' key is missing or null in response JSON.");
}
return rooms;
},
);
return response;
} catch (error, stackTrace) {
return []; // Return an empty list if there's an error
}
}
static Future<String> generateInvitationCode(