From 37d3d4ca801ab282104ed41d97e10911e288947a Mon Sep 17 00:00:00 2001 From: ilyayudovin Date: Mon, 29 Jun 2020 04:09:40 +0300 Subject: delete images in poll submission --- src/pages/FeedPage/PollSubmission.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/pages/FeedPage/PollSubmission.tsx') diff --git a/src/pages/FeedPage/PollSubmission.tsx b/src/pages/FeedPage/PollSubmission.tsx index 40ca3d7..9a3a042 100644 --- a/src/pages/FeedPage/PollSubmission.tsx +++ b/src/pages/FeedPage/PollSubmission.tsx @@ -54,9 +54,11 @@ const PollSubmission: React.FC = ({ user }) => { const handleClick = () => { if (expanded) { - post('/polls/', { authorId: user._id, contents }).then(res => { - console.log(res.data); - }); + if(contents.left?.url && contents.right?.url ) { + post('/polls/', {authorId: user._id, contents}).then(res => { + console.log(res.data); + }); + } } setExpanded(!expanded); }; -- cgit v1.2.3