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

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

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

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

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

export default userApi;