updateMembershipStatus method
Update team membership status
Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.
If the request is successful, a session for the user is automatically created.
Implementation
Future<models.Membership> updateMembershipStatus(
{required String teamId,
required String membershipId,
required String userId,
required String secret}) async {
final String apiPath = '/teams/{teamId}/memberships/{membershipId}/status'
.replaceAll('{teamId}', teamId)
.replaceAll('{membershipId}', membershipId);
final Map<String, dynamic> apiParams = {
'userId': userId,
'secret': secret,
};
final Map<String, String> apiHeaders = {
'content-type': 'application/json',
};
final res = await client.call(HttpMethod.patch,
path: apiPath, params: apiParams, headers: apiHeaders);
return models.Membership.fromMap(res.data);
}