source: frontend/src/Components/Hooks/Restaurant/useCreateTable.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: 675 bytes
Line 
1import React from "react";
2import axios from "../../../axios";
3import { useNavigate } from 'react-router-dom';
4
5const useCreateTable = () => {
6
7 const createTable = async (id, table, refresh) => {
8 console.log(table)
9 await axios
10 .post(`/restaurant/table/${id}/add`, null, {
11 params: table
12 })
13 .then((res) => {
14 console.log(res)
15 refresh(prev => ++prev)
16 //history.push('/restaurant');
17 })
18 .catch((err) => {
19 console.log(err);
20 })
21 .finally(() => {
22 });
23 }
24
25 return {
26 createTable
27 }
28}
29
30export default useCreateTable;
Note: See TracBrowser for help on using the repository browser.