Last change
on this file since efaa053 was e6c2521, checked in by darsov2 <62809499+darsov2@…>, 10 months ago |
images upload/download impl, other fixes
|
-
Property mode
set to
100644
|
File size:
581 bytes
|
Line | |
---|
1 | import React from "react";
|
---|
2 | import axios from "axios";
|
---|
3 | import { useHistory } from 'react-router-dom';
|
---|
4 |
|
---|
5 | const useRemoveReview = () => {
|
---|
6 |
|
---|
7 | const history = useHistory();
|
---|
8 | const removeReview = async ({id}) => {
|
---|
9 | await axios
|
---|
10 | .get(`/review/delete?userId=` + id)
|
---|
11 | .then((res) => {
|
---|
12 | history.push('/review');
|
---|
13 | })
|
---|
14 | .catch((err) => {
|
---|
15 | console.log(err);
|
---|
16 | })
|
---|
17 | .finally(() => {
|
---|
18 | });
|
---|
19 | }
|
---|
20 | return (
|
---|
21 | removeReview
|
---|
22 | )
|
---|
23 |
|
---|
24 | }
|
---|
25 |
|
---|
26 | export default useRemoveReview; |
---|
Note:
See
TracBrowser
for help on using the repository browser.