authenticatePartner method

Future<UserModel?> authenticatePartner({
  1. dynamic firstName,
  2. dynamic profileImg,
  3. dynamic socialMedia,
})

Implementation

Future<UserModel?> authenticatePartner({firstName, profileImg, socialMedia}) {
  Log(
    logName: 'AuthenticatePartner',
    className: 'User',
    methodName: 'authenticatePartner',
    type: 'INFO',
    text:
        '{event: Authenticate Partner, user: ${currentUser?.userPayloadId}, user is ${currentUser?.firstName} ${currentUser?.lastName}, prtaner info: first name- $firstName, profile image- $profileImg, social media- ${socialMedia.toString()}',
  );
  return _httpService
      .authenticatePartner(firstName: firstName, profileImg: profileImg)
      .then((data) async {
    if (data.statusCode >= 200 && data.statusCode < 300) {
      var res = json.decode(data.body);
      UserModel? userData;
      if (socialMedia != null) {
        userData = await updateUserMedia(
            socialMedia: socialMedia, userId: res['id']);
      } else {
        userData = UserModel.fromJson(res);
      }
      return userData;
    }
    return null;
  });
}