Commit 9dec93a5 authored by Kim, Subin's avatar Kim, Subin
Browse files

Todo 완성 중

parent 74e4b4db
import axios from "axios";
import baseUrl from "../utils/baseUrl";
const getTodo = async (userId, date = "", todoId = "") => {
const { data } = await axios.get(`${baseUrl}/api/todo/${userId}?todoId=${todoId}&date=${date}`)
return data
}
const submit = async (todo, userId) => {
const { data } = await axios.post(`${baseUrl}/api/todo/${userId}`, todo)
return data
}
const edit = async (todo, userId) => {
const { data } = await axios.put(`${baseUrl}/api/todo/${userId}?todoId=${todo.id}`, todo)
return data
}
const remove = async (todoId, userId) => {
const { data } = await axios.delete(`${baseUrl}/api/todo/${userId}?todoId=${todoId}`)
return data
}
const todoApi = {
getTodo,
submit,
edit,
remove
}
export default todoApi
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment