source: frontend/src/Components/Hooks/Restaurant/useCreateMenu.js@ e6c2521

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

images upload/download impl, other fixes

  • Property mode set to 100644
File size: 777 bytes
Line 
1import React from "react";
2import axios from "../../../axios";
3import { useNavigate } from 'react-router-dom';
4
5const 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
34export default useCreateMenu;
Note: See TracBrowser for help on using the repository browser.