aboutsummaryrefslogtreecommitdiff
path: root/src/Feed
diff options
context:
space:
mode:
authorilyayudovin <46264063+ilyayudovin@users.noreply.github.com>2020-06-14 15:58:02 +0300
committerGitHub <noreply@github.com>2020-06-14 15:58:02 +0300
commit99b44bc80fa3228131a05fccb13f75ff8a46b116 (patch)
treea77bcec54244156844e245494f1ce434a12fff34 /src/Feed
parent57a2ff3cfa7eae111bb8f46447198586c47425fb (diff)
parent0308460d896966a9fe5e510926f44bac112923bb (diff)
downloadwhich-ui-99b44bc80fa3228131a05fccb13f75ff8a46b116.tar.gz
Merge pull request #31 from ilyayudovin/signIn
add sing in form
Diffstat (limited to 'src/Feed')
-rw-r--r--src/Feed/Feed.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Feed/Feed.tsx b/src/Feed/Feed.tsx
index 21bda5e..d7bfce1 100644
--- a/src/Feed/Feed.tsx
+++ b/src/Feed/Feed.tsx
@@ -20,19 +20,19 @@ const Feed: React.FC<PropTypes> = ({ page }) => {
const [polls, setPolls] = useState<Poll[]>([]);
const classes = useStyles();
- let endpoint: string;
+ let endpoint = '/polls';
+ // TODO: Make this work
if (page === 'feed') endpoint = '/polls';
- else if (page === 'profiles') endpoint = '/profiles';
useEffect(() => {
get(endpoint).then(response => {
setPolls(response.data);
});
- }, []);
+ }, [endpoint]);
return (
<div className={classes.root}>
- {polls.map(poll => <PollCard poll={poll} />)}
+ {polls.map(poll => <PollCard poll={poll} key={poll._id} />)}
</div>
);
};