cinema.api.js 1.08 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
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
}

19
20
const getTicketFeeOne = async (theatertypeId) => {
    const { data } = await axios.get(`${baseUrl}/api/info/ticketfee/${theatertypeId}`)
21
22
23
24
25
26
27
28
    return data
}

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

29
30
const removeTicketFee = async (theatertypeId) => {
    const { data } = await axios.delete(`${baseUrl}/api/info/ticketfee?theaterTypeId=${theatertypeId}`)
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