theater.api.js 787 Bytes
Newer Older
Kim, Subin's avatar
theater    
Kim, Subin committed
1
2
3
4
5
6
7
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
37
import axios from "axios";
import { baseUrl } from "../utils/baseUrl.js";

const getAll = async () => {
    const { data } = await axios.get(`${baseUrl}/api/theater`)
    return data
}

const getOne = async () => {
    const { data } = await axios.get(`${baseUrl}/api/theater`)
    return data
}

const getTheaterType = async () => {
    const { data } = await axios.get(`${baseUrl}/api/theater/type`)
    return data
}

const sendData = async (theater) => {
    const { data } = await axios.put(`${baseUrl}/api/theater/type`, theater)
    return data
}

const remove = async () => {
    const { data } = await axios.delete(`${baseUrl}/api/theater`)
    return data
}

const theaterApi = {
    getAll,
    getOne,
    getTheaterType,
    sendData,
    remove
}

export default theaterApi