updated api

This commit is contained in:
hannathkadher
2024-11-18 15:36:33 +04:00
parent e33a07ac56
commit 836c44fd95
8 changed files with 125 additions and 75 deletions

View File

@ -20,7 +20,7 @@ class CommunitySpaceManagementApi {
return CommunityModel.fromJson(jsonItem);
}).toList();
return communityList;
},
},
);
return response;
} catch (e) {
@ -141,12 +141,19 @@ class CommunitySpaceManagementApi {
}
}
Future<SpaceModel?> createSpace(String communityId, String name,
{String? parentId, bool isPrivate = false}) async {
Future<SpaceModel?> createSpace({
required String communityId,
required String name,
String? parentId,
bool isPrivate = false,
required Offset position,
}) async {
try {
final body = {
'name': name,
'isPrivate': isPrivate,
'x': position.dx,
'y': position.dy,
};
if (parentId != null) {
body['parentId'] = parentId;
@ -219,5 +226,4 @@ class CommunitySpaceManagementApi {
return [];
}
}
}