community title will list from the api

This commit is contained in:
hannathkadher
2024-10-02 12:03:34 +04:00
parent 5d397691b6
commit 308a7adba7
4 changed files with 140 additions and 77 deletions

View File

@ -38,30 +38,3 @@ class SpacesResponse {
);
}
}
class CommunitySpaceManagementApi {
Future<SpacesResponse> fetchSpaces(String communityId) async {
try {
final response = await HTTPService().get(
path: ApiEndpoints.listSpaces.replaceAll('{communityId}', communityId),
showServerMessage: true,
expectedResponseModel: (json) {
return SpacesResponse.fromJson(json);
},
);
return response;
} catch (e) {
debugPrint('Error fetching spaces: $e');
return SpacesResponse(
data: [],
message: 'Error fetching spaces',
page: 1,
size: 10,
totalItem: 0,
totalPage: 0,
hasNext: false,
hasPrevious: false,
);
}
}
}