user.api.js 430 Bytes
Newer Older
1
import axios from "axios";
Kim, Chaerin's avatar
.    
Kim, Chaerin committed
2
import endpoints from "./endpoints";
3

Kim, Chaerin's avatar
.    
Kim, Chaerin committed
4
5
6
const login = async (payload) => {
  const { data } = await axios.post(`${endpoints.API_BASE_URL}/login`, payload);
  console.log(data);
7
8
9
  return data;
};

Kim, Chaerin's avatar
.    
Kim, Chaerin committed
10
11
12
13
14
15
16
17
18
19
20
const signup = async (payload) => {
  const { data } = await axios.post(
    `${endpoints.API_BASE_URL}/signup`,
    payload
  );
  return data;
};

const userApi = { login, signup };

export default userApi;