Last change
on this file since efaa053 was 07f4e8b, checked in by darsov2 <62809499+darsov2@…>, 16 months ago |
prefinal fixes
|
-
Property mode
set to
100644
|
File size:
674 bytes
|
Line | |
---|
1 | import React from "react";
|
---|
2 | import axios from "../../../axios";
|
---|
3 | import { useNavigate } from 'react-router-dom';
|
---|
4 |
|
---|
5 | const 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(Math.random())
|
---|
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 |
|
---|
30 | export default useCreateTable; |
---|
Note:
See
TracBrowser
for help on using the repository browser.