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

우지원's avatar
0728    
우지원 committed
3
4
const getRoom = async (id) => {
  const { data } = await axios.get(`/api/room/getRoom/${id}`);
우지원's avatar
e    
우지원 committed
5
6
7
  return data;
};

우지원's avatar
e    
우지원 committed
8
9
const create = async (payload) => {
  const { data } = await axios.post("/api/room/create", payload);
10
11
12
  return data;
};

우지원's avatar
e    
우지원 committed
13
14
const join = async (payload) => {
  const { data } = await axios.put("/api/room/join", payload);
15
16
17
  return data;
};

우지원's avatar
e    
우지원 committed
18
const roomApi = { getRoom, create, join };
19
20

export default roomApi;