source: frontend/src/Components/Hooks/useCreate.js@ 0f5aa27

Last change on this file since 0f5aa27 was 0f5aa27, checked in by darsov2 <62809499+darsov2@…>, 5 months ago

ouath, mailing impl

  • Property mode set to 100644
File size: 773 bytes
Line 
1import axios from "../../axios";
2
3const useCreate = () => {
4
5 //const history = useNavigate();
6 const createEntity = async (url, entity, getData, getData2) => {
7 console.log(entity)
8 await axios
9 .post(url, null, {
10 params: entity,
11 // headers: {
12 // 'Content-Type': 'multipart/form-data'
13 // }
14 })
15 .then((res) => {
16 //history.push('/hotel');
17 getData(prev => ++prev)
18 getData2(prev => ++prev)
19 })
20 .catch((err) => {
21 console.log(err);
22 })
23 .finally(() => {
24 });
25 }
26
27 return {
28 createEntity
29 };
30
31}
32
33export default useCreate;
Note: See TracBrowser for help on using the repository browser.