user.api.js 436 Bytes
Newer Older
1
2
import axios from "axios";

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

Kim, Chaerin's avatar
.    
Kim, Chaerin committed
8
const login = async (payload) => {
9
  const { data } = await axios.post("/api/login", payload);
10
11
12
  return data;
};

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

우지원's avatar
0726    
우지원 committed
18
const userApi = { getUser, login, signup };
Kim, Chaerin's avatar
.    
Kim, Chaerin committed
19
20

export default userApi;