Last change
on this file since ac19a0c was e9b4ba9, checked in by darsov2 <62809499+darsov2@…>, 9 months ago |
prototype
|
-
Property mode
set to
100644
|
File size:
777 bytes
|
Line | |
---|
1 | import React from "react";
|
---|
2 | import axios from "../../../axios";
|
---|
3 | import { useNavigate } from 'react-router-dom';
|
---|
4 |
|
---|
5 | const useCreateMenu = () => {
|
---|
6 |
|
---|
7 | const navigator = useNavigate();
|
---|
8 |
|
---|
9 | const createMenu = async (id, menu) => {
|
---|
10 | console.log(menu)
|
---|
11 | console.log(id)
|
---|
12 | await axios
|
---|
13 | .post(`/restaurant/` + id + "/menu/add", menu)
|
---|
14 | .then((res) => {
|
---|
15 | console.log("NOVO MENI");
|
---|
16 | console.log(res)
|
---|
17 | //window.location.reload()
|
---|
18 | //navigator("/resources/restaurant/" + id)
|
---|
19 | //history.push('/restaurant');
|
---|
20 | })
|
---|
21 | .catch((err) => {
|
---|
22 | console.log(err);
|
---|
23 | })
|
---|
24 | .finally(() => {
|
---|
25 | });
|
---|
26 | }
|
---|
27 |
|
---|
28 |
|
---|
29 | return {
|
---|
30 | createMenu
|
---|
31 | }
|
---|
32 | }
|
---|
33 |
|
---|
34 | export default useCreateMenu; |
---|
Note:
See
TracBrowser
for help on using the repository browser.