join method
Joins a challenge.
id is the ID of the challenge to join.
companyId is the company ID.
Returns success status.
Implementation
Future<ApiResponseModel<bool?>> join({
required String id,
required String companyId,
}) async {
final url = "$_baseUrl/challenges/$id/join";
final payload = {
'apiKey': _apiKey,
'companyId': companyId,
};
debugPrint("flutter_mon_sms_pro/challenges/join/payload: $payload");
final r = await _dio.post(url, data: payload);
debugPrint("flutter_mon_sms_pro/challenges/join/data: ${r.data}");
final response = ApiResponseModel.fromJson(
r.data,
(data) => (data as Map<String, dynamic>)['joined'] as bool?,
);
return response;
}