fixed issues in space

This commit is contained in:
hannathkadher
2024-10-30 11:04:36 +04:00
parent d025da6daf
commit 489789da0a
4 changed files with 26 additions and 13 deletions

View File

@ -269,17 +269,21 @@ class HomeCubit extends Cubit<HomeState> {
await fetchRoomsByUnitId(selectedSpace!);
emitSafe(GetSpacesSuccess(spaces!));
} else {
print("here in else");
emitSafe(GetSpacesError("No spaces found"));
}
}
fetchRoomsByUnitId(SpaceModel space) async {
print("Community ID: ${space.community.uuid}");
print("Space ID: ${space.id}");
emitSafe(GetSpaceRoomsLoading());
try {
space.subspaces =
await SpacesAPI.getSubSpaceBySpaceId(space.community.uuid, space.id);
} catch (failure) {
print("Error fetching subspaces: $failure");
emitSafe(GetSpaceRoomsError(failure.toString()));
return;
}