subscribe method

Future<ApiResponseModel<CompanyFollowedModel?>> subscribe({
  1. required String id,
  2. required String companyId,
})

Subscribes to a company.

id is the ID of the follower. companyId is the ID of the company to subscribe to. Returns the CompanyFollowedModel instance.

Implementation

Future<ApiResponseModel<CompanyFollowedModel?>> subscribe({
  required String id,
  required String companyId,
}) async {
  final url = "$_baseUrl/follower/$id/following/$companyId/subscribe";

  final payload = {};

  debugPrint("flutter_mon_sms_pro/follower/subscribe/payload: $payload");

  final r = await _dio.post(url, data: payload);

  debugPrint("flutter_mon_sms_pro/follower/subscribe/data: ${r.data}");

  final response = ApiResponseModel.fromJson(
    r.data,
    (data) => CompanyFollowedModel.fromJson(data as Map<String, dynamic>),
  );

  return response;
}