mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 01:56:19 +00:00
updated invitation code api
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user