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

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

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

export default userApi;