reservation.api.js 947 Bytes
Newer Older
한규민's avatar
한규민 committed
1
2
3
4
import axios from "axios";
import { baseUrl } from "../utils/baseUrl.js";

const findReservedSeats = async (timeTable) => {
Jiwon Yoon's avatar
Jiwon Yoon committed
5
    console.log(timeTable)
한규민's avatar
한규민 committed
6
    const url = `${baseUrl}/api/reservation/findreservation`;
Jiwon Yoon's avatar
Jiwon Yoon committed
7
    const { data } = await axios.post(url,{timeTable:timeTable});
한규민's avatar
한규민 committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
    return data
}

const findReservation = async () => {
    const url = `${baseUrl}/api/reservation/findreservation`;
    const { data } = await axios.get(url);
    return data
}

const findOneReservation = async () => {
    console.log("여기여기2");
    const url = `${baseUrl}/api/reservation/findonereservation`;
    const { data } = await axios.get(url);
    return data
}

const save = async (save) => {
    const url = `${baseUrl}/api/reservation/save`;
    const { data } = await axios.post(url, save);
    return data

}
const reservationApi = { 
    findReservation,
    findReservedSeats,
    findOneReservation,
    save
}
export default reservationApi