timetable.api.js 579 Bytes
Newer Older
1
2
3
import axios from "axios";
import { baseUrl } from "../utils/baseUrl.js";

Kim, Subin's avatar
Kim, Subin committed
4
5
const getAll = async (selectDate, movieId) => {
  const { data } = await axios.get(`${baseUrl}/api/timetable?when=${selectDate}&movieId=${movieId}`)
6
7
8
  return data
}

9
10
11
12
13
const submit = async (sendData) => {
  const { data } = await axios.post(`${baseUrl}/api/timetable`, sendData)
  return data
}

Kim, Subin's avatar
Kim, Subin committed
14
15
const remove = async (timeId) => {
  const { data } = await axios.delete(`${baseUrl}/api/timetable/${timeId}`)
16
17
18
  return data
}

19
const timetableApi = {
20
21
22
  getAll,
  submit,
  remove
23
24
25
}

export default timetableApi