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
4c649483
Commit
4c649483
authored
Nov 02, 2021
by
Kim, Subin
Browse files
서버 요청 수정중
parent
6db177d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
client/src/apis/schedule.api.js
0 → 100644
View file @
4c649483
import
axios
from
"
axios
"
;
import
baseUrl
from
"
../utils/baseUrl.js
"
;
const
submit
=
async
(
sendData
)
=>
{
const
{
data
}
=
await
axios
.
post
(
`
${
baseUrl
}
/`
,
sendData
);
return
data
}
const
scheduleApi
=
{
submit
}
export
default
scheduleApi
\ No newline at end of file
client/src/components/Form/ScheduleForm.js
View file @
4c649483
import
{
useState
,
useEffect
}
from
"
react
"
;
import
{
useState
,
useEffect
}
from
"
react
"
;
import
{
Redirect
,
useLocation
}
from
"
react-router-dom
"
;
import
{
Redirect
,
useLocation
}
from
"
react-router-dom
"
;
import
BtnGroup
from
"
../Buttons/BtnGroup.js
"
;
import
BtnGroup
from
"
../Buttons/BtnGroup.js
"
;
import
scheduleApi
from
"
../../apis/schedule.api.js
"
;
import
catchErrors
from
"
../../utils/catchErrors.js
"
;
import
catchErrors
from
"
../../utils/catchErrors.js
"
;
import
styles
from
"
./form.module.scss
"
;
import
styles
from
"
./form.module.scss
"
;
...
@@ -55,6 +56,7 @@ const ScheduleForm = () => {
...
@@ -55,6 +56,7 @@ const ScheduleForm = () => {
try
{
try
{
setError
(
""
)
setError
(
""
)
if
(
schedule
.
allDay
===
"
on
"
)
setSchedule
({
...
schedule
,
startTime
:
'
00:00
'
,
endTime
:
'
23:59
'
})
if
(
schedule
.
allDay
===
"
on
"
)
setSchedule
({
...
schedule
,
startTime
:
'
00:00
'
,
endTime
:
'
23:59
'
})
await
scheduleApi
.
submit
()
setSuccess
(
true
)
setSuccess
(
true
)
}
catch
(
error
)
{
}
catch
(
error
)
{
catchErrors
(
error
,
setError
)
catchErrors
(
error
,
setError
)
...
@@ -68,6 +70,7 @@ const ScheduleForm = () => {
...
@@ -68,6 +70,7 @@ const ScheduleForm = () => {
return
(
return
(
<
form
className
=
"
pt-5
"
onSubmit
=
{
handleSubmit
}
>
<
form
className
=
"
pt-5
"
onSubmit
=
{
handleSubmit
}
>
{
console
.
log
(
"
data==
"
,)}
<
div
>
<
div
>
<
input
className
=
{
`form-control form-control-lg shadow-none rounded-0 px-1 mb-5
${
styles
.
textInput
}
`
}
type
=
"
text
"
name
=
"
title
"
placeholder
=
"
제목
"
aria
-
label
=
"
title
"
onChange
=
{
handleChange
}
autoFocus
/>
<
input
className
=
{
`form-control form-control-lg shadow-none rounded-0 px-1 mb-5
${
styles
.
textInput
}
`
}
type
=
"
text
"
name
=
"
title
"
placeholder
=
"
제목
"
aria
-
label
=
"
title
"
onChange
=
{
handleChange
}
autoFocus
/>
<
/div
>
<
/div
>
...
...
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