user.api.js 745 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
오잉    
이재연 committed
19
20
const updateinfo = async (payload) => {
  const { data } = await axios.put("/api/updateinfo", payload);
이재연's avatar
aa    
이재연 committed
21
  return data;
이재연's avatar
오잉    
이재연 committed
22
23
24
25
26
27
};

const profileimg = async (formData) => {
  const { data } = await axios.put("/api/profileimg", formData);
  return data;
};
이재연's avatar
aa    
이재연 committed
28

이재연's avatar
오잉    
이재연 committed
29
const userApi = { login, signup, getUser, profileimg, updateinfo };
Kim, Chaerin's avatar
.    
Kim, Chaerin committed
30
31

export default userApi;