room.api.js 593 Bytes
Newer Older
1
2
import axios from "axios";

Kim, Chaerin's avatar
merge19    
Kim, Chaerin committed
3
const getRoom = async (id) => {
Kim, Chaerin's avatar
Kim, Chaerin committed
4
  const { data } = await axios.post('/api/room/getRoom', id);
Kim, Chaerin's avatar
merge19    
Kim, Chaerin committed
5
6
7
  return data;
};

우지원's avatar
우지원 committed
8
9
10
11
12
const exitRoom = async (ID) => {
  const { data } = await axios.delete(`/api/room/exitRoom/${ID.id}/${ID.roomId}`);
  return data;
};

Kim, Chaerin's avatar
Kim, Chaerin committed
13
14
const create = async (formData) => {
  const { data } = await axios.post("/api/room/create", formData);
15
16
17
  return data;
};

우지원's avatar
e    
우지원 committed
18
19
const join = async (payload) => {
  const { data } = await axios.put("/api/room/join", payload);
20
21
22
  return data;
};

우지원's avatar
우지원 committed
23
const roomApi = { getRoom, exitRoom, create, join };
24
25

export default roomApi;