plan.api.js 672 Bytes
Newer Older
Choi Ga Young's avatar
Choi Ga Young committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import axios from "axios";
import baseUrl from "../utils/baseUrl";

const addPlan = async (info, id) => {
  console.log('addPlan 확인', id)
  const url = `${baseUrl}/api/plan/addplan/${id}`
  const { data } = await axios.post(url, { info, id });
  return data
}

const editPlan = async (info, id) => {
  console.log('editPlan확인', id)
  const url = `${baseUrl}/api/plan/edit/${id}`
  const { data } = await axios.put(url, info);
  return data
}

const getDetail = async (id) => {
  const url = `${baseUrl}/api/plan/getDetail/${id}`
  const { data } = await axios.get(url)
  return data
}
const planApi = {
  addPlan,
  editPlan,
  getDetail
};

export default planApi