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
reservation-service
Commits
9cc867e8
Commit
9cc867e8
authored
Oct 31, 2020
by
CHAERIN KIM
Browse files
승인 미승인
parent
f3752c81
Changes
1
Show whitespace changes
Inline
Side-by-side
server/client/src/Pages/ACheckPage.js
View file @
9cc867e8
...
@@ -30,10 +30,19 @@ function ACheck(props) {
...
@@ -30,10 +30,19 @@ function ACheck(props) {
if
(
state
)
return
<
Redirect
to
=
"
/home
"
/>
;
if
(
state
)
return
<
Redirect
to
=
"
/home
"
/>
;
function
remove
(
index
)
{
function
remove
(
index
)
{
axios
.
delete
(
`/reserves/
${
reserve
[
index
].
_id
}
`
)
// axios.delete(`/reserves/${reserve[index]._id}`)
// .then(res => {
// if (res.status === 404) return alert(res.data.error)
// alert("삭제되었습니다!");
// getReserve();
// })
// .catch(err => {
// alert(err.error)
// });
axios
.
put
(
`/reserves/
${
reserve
[
index
].
_id
}
`
)
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
status
===
404
)
return
alert
(
res
.
data
.
error
)
if
(
res
.
status
===
404
)
return
alert
(
res
.
data
.
error
)
alert
(
"
삭제되었
습니다!
"
);
alert
(
"
승인을 거절했
습니다!
"
);
getReserve
();
getReserve
();
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
...
@@ -42,7 +51,9 @@ function ACheck(props) {
...
@@ -42,7 +51,9 @@ function ACheck(props) {
};
};
function
admit
(
index
)
{
function
admit
(
index
)
{
axios
.
put
(
`/reserves/
${
reserve
[
index
].
_id
}
`
)
axios
.
put
(
`/reserves/
${
reserve
[
index
].
_id
}
`
,
{
approve
:
true
,
})
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
status
===
404
)
return
alert
(
res
.
data
.
error
)
if
(
res
.
status
===
404
)
return
alert
(
res
.
data
.
error
)
alert
(
"
승인되었습니다!
"
);
alert
(
"
승인되었습니다!
"
);
...
@@ -69,12 +80,13 @@ function ACheck(props) {
...
@@ -69,12 +80,13 @@ function ACheck(props) {
<
/tr
>
<
/tr
>
<
/thead
>
<
/thead
>
<
tbody
>
<
tbody
>
{
reserve
.
map
((
reserve
,
index
)
=>
{
{
reserve
!=
""
?
(
reserve
.
map
((
reserve
,
index
)
=>
{
return
(
return
(
<
tr
key
=
{
index
}
>
<
tr
key
=
{
index
}
>
<
td
>
{
reserve
.
user
.
name
}
<
/td
>
<
td
>
{
reserve
.
user
.
name
}
<
/td
>
<
td
>
{
reserve
.
date
}
<
/td
>
<
td
>
{
reserve
.
date
}
<
/td
>
<
td
>
{
reserve
.
time
}
<
/td
>
<
td
>
{
reserve
.
starttime
}
시
~
{(
Number
(
reserve
.
starttime
)
+
reserve
.
usetime
)}
시
<
/td
>
<
td
>
{
reserve
.
room
}
<
/td
>
<
td
>
{
reserve
.
room
}
<
/td
>
<
td
>
{
reserve
.
num
}
<
/td
>
<
td
>
{
reserve
.
num
}
<
/td
>
<
td
>
<
td
>
...
@@ -87,7 +99,7 @@ function ACheck(props) {
...
@@ -87,7 +99,7 @@ function ACheck(props) {
<
/td
>
<
/td
>
<
/tr
>
<
/tr
>
)
)
})
}
}))
:
<
div
>
최근
대관
신청
내역이
없습니다
.
<
/div>
}
<
/tbody
>
<
/tbody
>
<
/table
>
<
/table
>
...
...
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