aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-10-09 03:31:07 +0300
committereug-vs <eug-vs@keemail.me>2020-10-09 03:31:07 +0300
commit5b81a690ed3c407aeb934b92fdad4a37c7e01a4b (patch)
tree818dc66ce2e45b5f29728b1e6654935d616ad3d5
parent6514ed55e3f608f468e103cacad547aed276b8bf (diff)
downloadwhich-ui-5b81a690ed3c407aeb934b92fdad4a37c7e01a4b.tar.gz
fix: update feedback list after review
-rw-r--r--src/containers/Home/ReviewForm.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/containers/Home/ReviewForm.tsx b/src/containers/Home/ReviewForm.tsx
index 32f3b19..56f4f8e 100644
--- a/src/containers/Home/ReviewForm.tsx
+++ b/src/containers/Home/ReviewForm.tsx
@@ -1,9 +1,9 @@
import React, { useState } from 'react';
-import { useHistory } from 'react-router-dom';
import { makeStyles } from '@material-ui/core/styles';
import { TextField, Button } from '@material-ui/core';
import { Rating } from '@material-ui/lab';
import { useSnackbar } from 'notistack';
+import { useFeedback } from '../../hooks/APIClient';
import { post } from '../../requests';
@@ -25,8 +25,8 @@ const useStyles = makeStyles(theme => ({
const ReviewForm: React.FC<PropTypes> = ({ version }) => {
const [contents, setContents] = useState<string>('');
const [score, setScore] = useState<number>(0);
+ const { mutate: updateFeedbacks } = useFeedback();
const classes = useStyles();
- const history = useHistory();
const { enqueueSnackbar } = useSnackbar();
const handleSubmit = (): void => {
@@ -35,7 +35,7 @@ const ReviewForm: React.FC<PropTypes> = ({ version }) => {
enqueueSnackbar('Your feedback has been submitted!', {
variant: 'success'
});
- history.push('/feed');
+ updateFeedbacks();
});
}
};