mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
Merge pull request #164 from SyncrowIOT/bugfix/space-model-with-tags
This commit is contained in:
@ -634,11 +634,11 @@ class SpaceManagementBloc extends Bloc<SpaceManagementEvent, SpaceManagementStat
|
|||||||
projectId: projectUuid);
|
projectId: projectUuid);
|
||||||
} else {
|
} else {
|
||||||
// Call create if the space does not have a UUID
|
// Call create if the space does not have a UUID
|
||||||
final List<CreateTagBodyModel> tagBodyModels = space.tags != null
|
List<CreateTagBodyModel> tagBodyModels = space.tags != null
|
||||||
? space.tags!.map((tag) => tag.toCreateTagBodyModel()).toList()
|
? space.tags!.map((tag) => tag.toCreateTagBodyModel()).toList()
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
final createSubspaceBodyModels = space.subspaces?.map((subspace) {
|
var createSubspaceBodyModels = space.subspaces?.map((subspace) {
|
||||||
final tagBodyModels =
|
final tagBodyModels =
|
||||||
subspace.tags?.map((tag) => tag.toCreateTagBodyModel()).toList() ?? [];
|
subspace.tags?.map((tag) => tag.toCreateTagBodyModel()).toList() ?? [];
|
||||||
return CreateSubspaceModel()
|
return CreateSubspaceModel()
|
||||||
@ -647,6 +647,11 @@ class SpaceManagementBloc extends Bloc<SpaceManagementEvent, SpaceManagementStat
|
|||||||
}).toList() ??
|
}).toList() ??
|
||||||
[];
|
[];
|
||||||
|
|
||||||
|
if (space.spaceModel?.uuid != null) {
|
||||||
|
tagBodyModels = [];
|
||||||
|
createSubspaceBodyModels = [];
|
||||||
|
}
|
||||||
|
|
||||||
final response = await _api.createSpace(
|
final response = await _api.createSpace(
|
||||||
communityId: communityUuid,
|
communityId: communityUuid,
|
||||||
name: space.name,
|
name: space.name,
|
||||||
|
Reference in New Issue
Block a user