mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
fixed update space
This commit is contained in:
@ -156,7 +156,7 @@ class CommunitySpaceManagementApi {
|
||||
.replaceAll('{spaceId}', spaceId)
|
||||
.replaceAll('{projectId}', TempConst.projectId),
|
||||
expectedResponseModel: (json) {
|
||||
return SpaceModel.fromJson(json);
|
||||
return SpaceModel.fromJson(json['data']);
|
||||
},
|
||||
);
|
||||
return response;
|
||||
@ -212,7 +212,7 @@ class CommunitySpaceManagementApi {
|
||||
}
|
||||
}
|
||||
|
||||
Future<SpaceModel?> updateSpace({
|
||||
Future<bool> updateSpace({
|
||||
required String communityId,
|
||||
required spaceId,
|
||||
required String name,
|
||||
@ -232,13 +232,13 @@ class CommunitySpaceManagementApi {
|
||||
'y': position.dy,
|
||||
'direction': direction,
|
||||
'icon': icon,
|
||||
'subspace':subspaces,
|
||||
'tags':tags,
|
||||
'subspace': subspaces,
|
||||
'tags': tags,
|
||||
};
|
||||
if (parentId != null) {
|
||||
body['parentUuid'] = parentId;
|
||||
}
|
||||
|
||||
|
||||
final response = await HTTPService().put(
|
||||
path: ApiEndpoints.updateSpace
|
||||
.replaceAll('{communityId}', communityId)
|
||||
@ -246,13 +246,13 @@ class CommunitySpaceManagementApi {
|
||||
.replaceAll('{projectId}', TempConst.projectId),
|
||||
body: body,
|
||||
expectedResponseModel: (json) {
|
||||
return SpaceModel.fromJson(json['data']);
|
||||
return json['success'] ?? false;
|
||||
},
|
||||
);
|
||||
return response;
|
||||
} catch (e) {
|
||||
debugPrint('Error creating space: $e');
|
||||
return null;
|
||||
debugPrint('Error updating space: $e');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user