Commit eeb2fff2 authored by CHAERIN KIM's avatar CHAERIN KIM
Browse files

시간중복방지

parent 30c95dda
...@@ -22,27 +22,26 @@ function Apply(props) { ...@@ -22,27 +22,26 @@ function Apply(props) {
} }
function time(starttime) { function time(starttime) {
console.log(starttime) if (starttime == 21) {
if (starttime == 21) { return (<Field as="select" name="usetime">
return (<Field as="select" name="usetime"> <option value="">이용시간을 선택하세요</option>
<option value="">이용시간을 선택하세요</option> <option value="1">1시간</option>
<option value="1">1시간</option> </Field>)
</Field>) }
} if (starttime == 20) {
if (starttime == 20) {
return (<Field as="select" name="usetime">
<option value="">이용시간을 선택하세요</option>
<option value="1">1시간</option>
<option value="2">2시간</option>
</Field>)
}
return (<Field as="select" name="usetime"> return (<Field as="select" name="usetime">
<option value="">이용시간을 선택하세요</option> <option value="">이용시간을 선택하세요</option>
<option value="1">1시간</option> <option value="1">1시간</option>
<option value="2">2시간</option> <option value="2">2시간</option>
<option value="3">3시간</option>
</Field>) </Field>)
}
return (<Field as="select" name="usetime">
<option value="">이용시간을 선택하세요</option>
<option value="1">1시간</option>
<option value="2">2시간</option>
<option value="3">3시간</option>
</Field>)
} }
function getUser() { function getUser() {
...@@ -93,17 +92,21 @@ function Apply(props) { ...@@ -93,17 +92,21 @@ function Apply(props) {
url: '/reserves', url: '/reserves',
data: values data: values
}).then(res => { }).then(res => {
if (res.status === 404) return alert(res.data.error) if (res.status === 404) {
alert(res.data.error)
return window.location.reload();
}
alert("신청이 완료되었습니다!"); alert("신청이 완료되었습니다!");
setState(true); setState(true);
console.log("res.data", res.data)
}) })
.catch(err => { .catch(err => {
alert(err.error) alert(err.error)
}); });
// setTimeout(() => { setTimeout(() => {
// setSubmitting(false); setSubmitting(false);
// }, 400); // finish the cycle in handler }, 400); // finish the cycle in handler
}} }}
> >
{({ {({
......
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