createPollVote method

Future<PollVoteModel?> createPollVote(
  1. dynamic pollOption,
  2. dynamic user
)

Implementation

Future<PollVoteModel?> createPollVote(pollOption, user) {
  Log(
    logName: 'CreatePollVote',
    className: 'Poll',
    methodName: 'createPollVote',
    type: 'INFO',
    text:
        '{event: Create Poll Vote, user: ${currentUser?.userPayloadId}, user is ${currentUser?.firstName} ${currentUser?.lastName}, poll vote option: $pollOption',
  );
  return _httpService
      .createPollVote(pollOption: pollOption, user: user)
      .then((data) async {
    if (data.statusCode >= 200 && data.statusCode < 300) {
      var res = json.decode(data.body);

      PollVoteModel pollVoteData = PollVoteModel.fromJson(res[0]);
      return pollVoteData;
    }
    return null;
  });
}