getGoalStatus method

  1. @override
Future<GoalStatusInfo> getGoalStatus({
  1. required String token,
  2. required String goalId,
})
override

Implementation

@override
Future<GoalStatusInfo> getGoalStatus({
  required String token,
  required String goalId,
}) async {
  final response = await dio.post(
    '/microsite/participants/goals/status',
    options: Options(headers: {'Authorization': 'Bearer $token'}),
    data: {
      'api_key': Environment.apiKey,
      'campaign': Environment.campaign,
      'goal_id': goalId,
    },
  );
  final Map<String, dynamic> responseData = jsonDecode(response.data);
  return GoalMapper.getGoalStatusInfoToEntity(GoalStatusInfoResponse.fromJson(responseData));
}