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:
755 bytes
|
Line | |
---|
1 | import React from "react";
|
---|
2 |
|
---|
3 | import axios from "../../../axios.js";
|
---|
4 | import { useNavigate } from "react-router-dom";
|
---|
5 |
|
---|
6 | const useCreateBusiness = () => {
|
---|
7 |
|
---|
8 | //const history = useNavigate();
|
---|
9 | const createBusiness = async (business) => {
|
---|
10 | console.log({business})
|
---|
11 | console.log(business)
|
---|
12 | await axios
|
---|
13 | .post(`/business/add`, business, {
|
---|
14 | params: {
|
---|
15 | userId: localStorage.getItem("userId")
|
---|
16 | }
|
---|
17 | })
|
---|
18 | .then((res) => {
|
---|
19 | //window.location.reload()
|
---|
20 | //history.push('/hotel');
|
---|
21 | })
|
---|
22 | .catch((err) => {
|
---|
23 | console.log(err);
|
---|
24 | })
|
---|
25 | .finally(() => {
|
---|
26 | });
|
---|
27 | }
|
---|
28 |
|
---|
29 | return {
|
---|
30 | createBusiness
|
---|
31 | };
|
---|
32 |
|
---|
33 | }
|
---|
34 |
|
---|
35 | export default useCreateBusiness; |
---|
Note:
See
TracBrowser
for help on using the repository browser.