Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
Today KU
Commits
9dec93a5
Commit
9dec93a5
authored
Nov 05, 2021
by
Kim, Subin
Browse files
Todo 완성 중
parent
74e4b4db
Changes
1
Hide whitespace changes
Inline
Side-by-side
client/src/apis/todo.api.js
0 → 100644
View file @
9dec93a5
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment