updated invitation code api

This commit is contained in:
hannathkadher
2024-11-05 11:01:49 +04:00
parent 7d51ca1f12
commit 34536e6584
3 changed files with 15 additions and 7 deletions

View File

@ -61,12 +61,19 @@ class SpacesAPI {
}
static Future<String> generateInvitationCode(
String unitId,
) async {
String unitId, String communityId) async {
final response = await _httpService.get(
path: ApiEndpoints.invitationCode.replaceAll('{unitUuid}', unitId),
path: ApiEndpoints.invitationCode
.replaceAll('{unitUuid}', unitId)
.replaceAll('{communityUuid}', communityId),
showServerMessage: false,
expectedResponseModel: (json) => json['invitationCode'],
expectedResponseModel: (json) {
if (json != null && json['data'] != null) {
return json['data']['invitationCode'];
} else {
throw Exception('Data field is null');
}
},
);
return response;
}