cinema.api.js 1.07 KB
Newer Older
Kim, Subin's avatar
Kim, Subin committed
1
import axios from "axios";
2
import { baseUrl } from "../utils/baseUrl.js";
Kim, Subin's avatar
Kim, Subin committed
3

4
5
const getCinemaInfo = async () => {
    const { data } = await axios.get(`${baseUrl}/api/info/cinema`)
Kim, Subin's avatar
Kim, Subin committed
6
7
8
    return data
}

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const editCinema = async (cinemaInfo) => {
    const { data } = await axios.put(`${baseUrl}/api/info/cinema`, cinemaInfo)
    return data
}

const getTicketFee = async () => {
    const { data } = await axios.get(`${baseUrl}/api/info/ticketfee`)
    return data
}

const getTicketFeeOne = async (theaterType) => {
    const { data } = await axios.get(`${baseUrl}/api/info/ticketfee/${theaterType}`)
    return data
}

const editTicketFee = async (ticketFeeInfo) => {
    const { data } = await axios.put(`${baseUrl}/api/info/ticketfee`, ticketFeeInfo)
    return data
}

const removeTicketFee = async (theaterType) => {
    const { data } = await axios.delete(`${baseUrl}/api/info/ticketfee?theaterType=${theaterType}`)
Kim, Subin's avatar
Kim, Subin committed
31
32
33
34
    return data
}

const cinemaApi = {
35
36
37
38
39
40
    getCinemaInfo,
    editCinema,
    getTicketFee,
    getTicketFeeOne,
    editTicketFee,
    removeTicketFee
Kim, Subin's avatar
Kim, Subin committed
41
42
43
}

export default cinemaApi