updated subspace edit flow

This commit is contained in:
hannathkadher
2025-01-22 17:21:35 +04:00
parent f35b699d4c
commit ba7db3a5fb
5 changed files with 70 additions and 134 deletions

View File

@ -408,7 +408,9 @@ class SpaceManagementBloc
Future<List<SpaceModel>> saveSpacesHierarchically(
List<SpaceModel> spaces, String communityUuid) async {
print("space");
final orderedSpaces = flattenHierarchy(spaces);
print("parent");
final parentsToDelete = orderedSpaces.where((space) =>
space.status == SpaceStatus.deleted &&
@ -420,9 +422,10 @@ class SpaceManagementBloc
await _api.deleteSpace(communityUuid, parent.uuid!);
}
} catch (e) {
rethrow; // Decide whether to stop execution or continue
rethrow;
}
}
orderedSpaces.removeWhere((space) => parentsToDelete.contains(space));
for (var space in orderedSpaces) {
try {