aboutsummaryrefslogtreecommitdiff
path: root/src/containers
diff options
context:
space:
mode:
Diffstat (limited to 'src/containers')
-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();
});
}
};