stream-chat-react-native-core
Version:
The official React Native and Expo components for Stream Chat, a service for building chat applications
50 lines • 1.69 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.mapStorableToPoll = void 0;
var mapStorableToPoll = pollRow => {
var allow_answers = pollRow.allow_answers,
allow_user_suggested_options = pollRow.allow_user_suggested_options,
answers_count = pollRow.answers_count,
created_at = pollRow.created_at,
created_by = pollRow.created_by,
created_by_id = pollRow.created_by_id,
description = pollRow.description,
enforce_unique_vote = pollRow.enforce_unique_vote,
id = pollRow.id,
is_closed = pollRow.is_closed,
latest_answers = pollRow.latest_answers,
latest_votes_by_option = pollRow.latest_votes_by_option,
max_votes_allowed = pollRow.max_votes_allowed,
name = pollRow.name,
options = pollRow.options,
own_votes = pollRow.own_votes,
updated_at = pollRow.updated_at,
vote_count = pollRow.vote_count,
vote_counts_by_option = pollRow.vote_counts_by_option,
voting_visibility = pollRow.voting_visibility;
return {
allow_answers,
allow_user_suggested_options,
answers_count,
created_at,
created_by: JSON.parse(created_by),
created_by_id,
description,
enforce_unique_vote,
id,
is_closed,
latest_answers: JSON.parse(latest_answers),
latest_votes_by_option: JSON.parse(latest_votes_by_option),
max_votes_allowed,
name,
options: JSON.parse(options),
own_votes: own_votes ? JSON.parse(own_votes) : [],
updated_at,
vote_count,
vote_counts_by_option: JSON.parse(vote_counts_by_option),
voting_visibility: voting_visibility
};
};
exports.mapStorableToPoll = mapStorableToPoll;
//# sourceMappingURL=mapStorableToPoll.js.map