requestAcceptRejectApi function

Future<String> requestAcceptRejectApi(
  1. {required int userId,
  2. required String notificationId,
  3. bool confirmTap = true}
)

Implementation

Future<String> requestAcceptRejectApi({required int userId, required String notificationId, bool confirmTap = true}) async {
  appStore.setLoading(true);

  Map req = {FriendKey.following: appStore.userId, FriendKey.followers: userId, FriendKey.notificationId: notificationId};
  try {
    var res = CommonModel.fromJson(await (handleResponse(await buildHttpResponse(confirmTap ? APIEndPoint.acceptFollowRequest : APIEndPoint.rejectFollowRequest, request: req, method: HttpMethod.POST))));
    appStore.setLoading(false);
    return res.message.validate();
  } catch (e) {
    appStore.setLoading(false);
    throw errorSomethingWentWrong;
  }
}