From fbdaa40e7ce585b65038835c05a283cec6f28d0e Mon Sep 17 00:00:00 2001 From: eug-vs Date: Wed, 24 Jun 2020 00:52:26 +0300 Subject: chore: migrate to which-types@1.3.1 --- src/components/PollCard/PollCard.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/components/PollCard') diff --git a/src/components/PollCard/PollCard.tsx b/src/components/PollCard/PollCard.tsx index 190d001..9f89d9a 100644 --- a/src/components/PollCard/PollCard.tsx +++ b/src/components/PollCard/PollCard.tsx @@ -7,7 +7,8 @@ import { Avatar, CardHeader } from '@material-ui/core/'; -import { Poll } from '../../types'; +import { Which, Poll } from 'which-types'; + import PercentageBar from './PercentageBar'; import {post} from '../../requests'; import teal from "@material-ui/core/colors/teal"; @@ -56,7 +57,7 @@ const PollCard: React.FC = ({ poll, navigate }) => { navigate('profile', poll.author._id); }; - const vote = (which: 'left' | 'right') => { + const vote = (which: Which) => { post(`polls/${ poll._id }/votes/`,{ which }).then((response)=>{ console.log(response.data); const leftV = response.data.contents.left.votes; @@ -78,12 +79,12 @@ const PollCard: React.FC = ({ poll, navigate }) => { )} - title={author.name} + title={author.username} />
vote('left')}> -- cgit v1.2.3