auth.api.js 455 Bytes
Newer Older
1
import axios from "axios";
Kim, Subin's avatar
Kim, Subin committed
2
import baseUrl from "../utils/baseUrl.js";
3
4

const signup = async (user) => {
Kim, Subin's avatar
Kim, Subin committed
5
  const url = `${baseUrl}/api/auth/signup`;
Choi Ga Young's avatar
Choi Ga Young committed
6
  const { data, status } = await axios.post(url, user);
7
8
9
10
  return { data, status }
}

const login = async (user) => {
Kim, Subin's avatar
Kim, Subin committed
11
  const url = `${baseUrl}/api/auth/login`;
12
13
  const { data, status } = await axios.post(url, user);
  return { data, status }
14
15
16
}

const authApi = {
Kim, Subin's avatar
Kim, Subin committed
17
  signup,
18
  login
19
20
21
};

export default authApi