updateUserMedia method

Future<UserModel?> updateUserMedia({
  1. required dynamic socialMedia,
  2. dynamic userId,
})

Implementation

Future<UserModel?> updateUserMedia({required socialMedia, userId}) async {
  Log(
    logName: 'UpdateUserMedia',
    className: 'User',
    methodName: 'updateUserMedia',
    type: 'INFO',
    text:
        '{event: Update User Media, user: ${currentUser?.userPayloadId}, user is ${currentUser?.firstName} ${currentUser?.lastName}, user id: $userId, social media: ${socialMedia.toString()}',
  );
  UserModel userModel;
  return await _httpService
      .updateUserMedia(socialMedia: socialMedia, userId: userId)
      .then((user) {
    if (user.statusCode >= 200 && user.statusCode < 300) {
      var res = json.decode(user.body);
      userModel = UserModel.fromJson(res);
      return userModel;
    }
    return null;
  });
}