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
7f10fdd0
Commit
7f10fdd0
authored
Nov 06, 2020
by
Yoon, Daeki
😅
Browse files
axios url 변경 /app/rental
parent
04d81309
Changes
13
Hide whitespace changes
Inline
Side-by-side
client/src/Components/Menu.js
View file @
7f10fdd0
...
@@ -28,7 +28,7 @@ function Menu() {
...
@@ -28,7 +28,7 @@ function Menu() {
},
[])
},
[])
function
acheck
()
{
function
acheck
()
{
axios
.
get
(
`/api/users/
${
localStorage
.
getItem
(
'
_id
'
)}
`
,
{
axios
.
get
(
`/
app/rental/
api/users/
${
localStorage
.
getItem
(
'
_id
'
)}
`
,
{
headers
:
{
authorization
:
localStorage
.
getItem
(
'
token
'
)
},
headers
:
{
authorization
:
localStorage
.
getItem
(
'
token
'
)
},
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
data
.
role
==
"
admin
"
)
{
if
(
res
.
data
.
role
==
"
admin
"
)
{
...
...
client/src/Components/Schedule.js
View file @
7f10fdd0
...
@@ -20,7 +20,7 @@ function Cal(props) {
...
@@ -20,7 +20,7 @@ function Cal(props) {
});
});
function
getReserve
(
room
)
{
function
getReserve
(
room
)
{
axios
.
get
(
`/api/reserves/room/
${
room
}
`
,
{
axios
.
get
(
`/
app/rental/
api/reserves/room/
${
room
}
`
,
{
headers
:
{
authorization
:
localStorage
.
getItem
(
'
token
'
)
},
headers
:
{
authorization
:
localStorage
.
getItem
(
'
token
'
)
},
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
...
...
client/src/Pages/ACheckPage.js
View file @
7f10fdd0
...
@@ -31,7 +31,7 @@ function ACheck(props) {
...
@@ -31,7 +31,7 @@ function ACheck(props) {
},
[])
},
[])
function
getReserve
()
{
function
getReserve
()
{
axios
.
get
(
`/api/users/admin/
${
props
.
match
.
params
.
id
}
`
,
{
axios
.
get
(
`/
app/rental/
api/users/admin/
${
props
.
match
.
params
.
id
}
`
,
{
headers
:
{
authorization
:
localStorage
.
getItem
(
'
token
'
)
},
headers
:
{
authorization
:
localStorage
.
getItem
(
'
token
'
)
},
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
...
@@ -48,7 +48,7 @@ function ACheck(props) {
...
@@ -48,7 +48,7 @@ function ACheck(props) {
if
(
state
)
return
<
Redirect
to
=
"
/
"
/>
;
if
(
state
)
return
<
Redirect
to
=
"
/
"
/>
;
function
remove
(
index
)
{
function
remove
(
index
)
{
axios
.
put
(
`/api/reserves/
${
reserve
[
index
].
_id
}
`
)
axios
.
put
(
`/
app/rental/
api/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
(
"
승인을 거절했습니다!
"
);
...
@@ -60,7 +60,7 @@ function ACheck(props) {
...
@@ -60,7 +60,7 @@ function ACheck(props) {
};
};
function
admit
(
index
)
{
function
admit
(
index
)
{
axios
.
put
(
`/api/reserves/
${
reserve
[
index
].
_id
}
`
,
{
axios
.
put
(
`/
app/rental/
api/reserves/
${
reserve
[
index
].
_id
}
`
,
{
approve
:
true
,
approve
:
true
,
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
...
...
client/src/Pages/ApplyPage.js
View file @
7f10fdd0
...
@@ -47,7 +47,7 @@ function Apply(props) {
...
@@ -47,7 +47,7 @@ function Apply(props) {
}
}
function
getUser
()
{
function
getUser
()
{
axios
.
get
(
`/api/users/
${
props
.
match
.
params
.
id
}
`
,
{
axios
.
get
(
`/
app/rental/
api/users/
${
props
.
match
.
params
.
id
}
`
,
{
headers
:
{
authorization
:
localStorage
.
getItem
(
'
token
'
)
},
headers
:
{
authorization
:
localStorage
.
getItem
(
'
token
'
)
},
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
...
@@ -101,7 +101,7 @@ function Apply(props) {
...
@@ -101,7 +101,7 @@ function Apply(props) {
addRoomInfo
(
values
);
addRoomInfo
(
values
);
axios
({
axios
({
method
:
'
post
'
,
method
:
'
post
'
,
url
:
'
/api/reserves
'
,
url
:
'
/
app/rental/
api/reserves
'
,
data
:
values
data
:
values
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
status
===
404
)
{
if
(
res
.
status
===
404
)
{
...
...
client/src/Pages/ChangePage.js
View file @
7f10fdd0
...
@@ -50,7 +50,7 @@ function Change(props) {
...
@@ -50,7 +50,7 @@ function Change(props) {
.
oneOf
([
Yup
.
ref
(
"
password
"
),
null
],
'
비밀번호가 일치하지 않습니다.
'
),
.
oneOf
([
Yup
.
ref
(
"
password
"
),
null
],
'
비밀번호가 일치하지 않습니다.
'
),
})}
})}
onSubmit
=
{(
values
,
{
setSubmitting
})
=>
{
onSubmit
=
{(
values
,
{
setSubmitting
})
=>
{
axios
.
put
(
`/api/users/change/
${
props
.
location
.
state
.
id
}
`
,
{
...
values
},
axios
.
put
(
`/
app/rental/
api/users/change/
${
props
.
location
.
state
.
id
}
`
,
{
...
values
},
)
)
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
log
(
res
.
data
);
console
.
log
(
res
.
data
);
...
...
client/src/Pages/CheckPage.js
View file @
7f10fdd0
...
@@ -37,7 +37,7 @@ function Check(props) {
...
@@ -37,7 +37,7 @@ function Check(props) {
if
(
state
)
return
<
Redirect
to
=
"
/
"
/>
;
if
(
state
)
return
<
Redirect
to
=
"
/
"
/>
;
function
getReserve
()
{
function
getReserve
()
{
axios
.
get
(
`/api/reserves/
${
props
.
match
.
params
.
id
}
`
,
{
axios
.
get
(
`/
app/rental/
api/reserves/
${
props
.
match
.
params
.
id
}
`
,
{
headers
:
{
authorization
:
localStorage
.
getItem
(
'
token
'
)
},
headers
:
{
authorization
:
localStorage
.
getItem
(
'
token
'
)
},
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
...
@@ -59,7 +59,7 @@ function Check(props) {
...
@@ -59,7 +59,7 @@ function Check(props) {
});
});
}
}
function
remove
(
index
)
{
function
remove
(
index
)
{
axios
.
delete
(
`/api/reserves/
${
reserve
[
index
].
_id
}
`
)
axios
.
delete
(
`/
app/rental/
api/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
(
"
삭제되었습니다!
"
);
...
...
client/src/Pages/FindPage.js
View file @
7f10fdd0
...
@@ -43,7 +43,7 @@ function Find() {
...
@@ -43,7 +43,7 @@ function Find() {
onSubmit
=
{(
values
,
{
setSubmitting
})
=>
{
onSubmit
=
{(
values
,
{
setSubmitting
})
=>
{
axios
({
axios
({
method
:
'
post
'
,
method
:
'
post
'
,
url
:
'
/api/login/find
'
,
url
:
'
/
app/rental/
api/login/find
'
,
data
:
values
,
data
:
values
,
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
status
===
404
)
return
alert
(
res
.
data
.
error
)
if
(
res
.
status
===
404
)
return
alert
(
res
.
data
.
error
)
...
...
client/src/Pages/HomePage.js
View file @
7f10fdd0
...
@@ -16,7 +16,7 @@ function Home() {
...
@@ -16,7 +16,7 @@ function Home() {
if
(
state
)
return
<
Redirect
to
=
"
/
"
/>
;
if
(
state
)
return
<
Redirect
to
=
"
/
"
/>
;
function
tcheck
()
{
function
tcheck
()
{
axios
.
get
(
`/api/users/
${
localStorage
.
getItem
(
'
_id
'
)}
`
,
{
axios
.
get
(
`/
app/rental/
api/users/
${
localStorage
.
getItem
(
'
_id
'
)}
`
,
{
headers
:
{
authorization
:
localStorage
.
getItem
(
'
token
'
)
},
headers
:
{
authorization
:
localStorage
.
getItem
(
'
token
'
)
},
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
...
...
client/src/Pages/LoginPage.js
View file @
7f10fdd0
...
@@ -125,7 +125,7 @@ function Login() {
...
@@ -125,7 +125,7 @@ function Login() {
onSubmit
=
{(
values
,
{
setSubmitting
})
=>
{
onSubmit
=
{(
values
,
{
setSubmitting
})
=>
{
axios
({
axios
({
method
:
'
post
'
,
method
:
'
post
'
,
url
:
'
/api/login
'
,
url
:
'
/
app/rental/
api/login
'
,
data
:
values
,
data
:
values
,
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
status
===
404
)
return
alert
(
res
.
data
.
error
)
if
(
res
.
status
===
404
)
return
alert
(
res
.
data
.
error
)
...
...
client/src/Pages/ModifyPage.js
View file @
7f10fdd0
...
@@ -25,7 +25,7 @@ function Modify({ match }) {
...
@@ -25,7 +25,7 @@ function Modify({ match }) {
function
getOne
(
id
)
{
function
getOne
(
id
)
{
if
(
id
)
{
if
(
id
)
{
axios
.
get
(
`/api/notices/
${
match
.
params
.
id
}
`
)
axios
.
get
(
`/
app/rental/
api/notices/
${
match
.
params
.
id
}
`
)
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
status
!==
201
)
{
if
(
res
.
status
!==
201
)
{
alert
(
res
.
data
.
error
);
alert
(
res
.
data
.
error
);
...
@@ -39,7 +39,7 @@ function Modify({ match }) {
...
@@ -39,7 +39,7 @@ function Modify({ match }) {
};
};
function
acheck
()
{
function
acheck
()
{
axios
.
get
(
`/api/users/admin/
${
localStorage
.
getItem
(
'
_id
'
)}
`
,
{
axios
.
get
(
`/
app/rental/
api/users/admin/
${
localStorage
.
getItem
(
'
_id
'
)}
`
,
{
headers
:
{
authorization
:
localStorage
.
getItem
(
'
token
'
)
},
headers
:
{
authorization
:
localStorage
.
getItem
(
'
token
'
)
},
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
...
@@ -73,7 +73,7 @@ function Modify({ match }) {
...
@@ -73,7 +73,7 @@ function Modify({ match }) {
onSubmit
=
{(
values
,
{
setSubmitting
})
=>
{
onSubmit
=
{(
values
,
{
setSubmitting
})
=>
{
axios
({
axios
({
method
:
'
put
'
,
method
:
'
put
'
,
url
:
`/api/writes/
${
match
.
params
.
id
}
`
,
url
:
`/
app/rental/
api/writes/
${
match
.
params
.
id
}
`
,
data
:
values
,
data
:
values
,
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
...
...
client/src/Pages/NoticePage.js
View file @
7f10fdd0
...
@@ -18,7 +18,7 @@ function Notice() {
...
@@ -18,7 +18,7 @@ function Notice() {
if
(
state
)
return
<
Redirect
to
=
"
/
"
/>
;
if
(
state
)
return
<
Redirect
to
=
"
/
"
/>
;
function
acheck
()
{
function
acheck
()
{
axios
.
get
(
`/api/users/
${
localStorage
.
getItem
(
'
_id
'
)}
`
,
{
axios
.
get
(
`/
app/rental/
api/users/
${
localStorage
.
getItem
(
'
_id
'
)}
`
,
{
headers
:
{
authorization
:
localStorage
.
getItem
(
'
token
'
)
},
headers
:
{
authorization
:
localStorage
.
getItem
(
'
token
'
)
},
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
...
@@ -36,7 +36,7 @@ function Notice() {
...
@@ -36,7 +36,7 @@ function Notice() {
}
}
function
remove
(
card_id
)
{
function
remove
(
card_id
)
{
axios
.
delete
(
`/api/notices/
${
card_id
}
`
)
axios
.
delete
(
`/
app/rental/
api/notices/
${
card_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
(
"
삭제되었습니다!
"
);
...
@@ -49,7 +49,7 @@ function Notice() {
...
@@ -49,7 +49,7 @@ function Notice() {
function
getNotice
()
{
function
getNotice
()
{
axios
.
get
(
`/api/notices`
)
axios
.
get
(
`/
app/rental/
api/notices`
)
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
log
(
'
res.data=
'
,
res
.
data
)
console
.
log
(
'
res.data=
'
,
res
.
data
)
if
(
res
.
status
!==
201
)
{
if
(
res
.
status
!==
201
)
{
...
...
client/src/Pages/SignupPage.js
View file @
7f10fdd0
...
@@ -62,7 +62,7 @@ function Signup() {
...
@@ -62,7 +62,7 @@ function Signup() {
onSubmit
=
{(
values
,
{
setSubmitting
})
=>
{
onSubmit
=
{(
values
,
{
setSubmitting
})
=>
{
axios
({
axios
({
method
:
'
post
'
,
method
:
'
post
'
,
url
:
'
/api/users
'
,
url
:
'
/
app/rental/
api/users
'
,
data
:
values
,
data
:
values
,
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
status
===
404
)
return
alert
(
res
.
data
.
error
)
if
(
res
.
status
===
404
)
return
alert
(
res
.
data
.
error
)
...
...
client/src/Pages/WritePage.js
View file @
7f10fdd0
...
@@ -22,7 +22,7 @@ function Write() {
...
@@ -22,7 +22,7 @@ function Write() {
}
}
function
acheck
()
{
function
acheck
()
{
axios
.
get
(
`/api/users/admin/
${
localStorage
.
getItem
(
'
_id
'
)}
`
,
{
axios
.
get
(
`/
app/rental/
api/users/admin/
${
localStorage
.
getItem
(
'
_id
'
)}
`
,
{
headers
:
{
authorization
:
localStorage
.
getItem
(
'
token
'
)
},
headers
:
{
authorization
:
localStorage
.
getItem
(
'
token
'
)
},
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
...
@@ -56,7 +56,7 @@ function Write() {
...
@@ -56,7 +56,7 @@ function Write() {
console
.
log
(
values
)
console
.
log
(
values
)
axios
({
axios
({
method
:
'
post
'
,
method
:
'
post
'
,
url
:
'
/api/writes
'
,
url
:
'
/
app/rental/
api/writes
'
,
data
:
values
,
data
:
values
,
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
status
===
404
)
return
alert
(
res
.
data
.
error
)
if
(
res
.
status
===
404
)
return
alert
(
res
.
data
.
error
)
...
...
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