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
search-page
Commits
2f8421dd
Commit
2f8421dd
authored
Mar 22, 2021
by
Kim, Chaerin
Browse files
last
parent
4071c980
Changes
9
Show whitespace changes
Inline
Side-by-side
client/.eslintcache
View file @
2f8421dd
[{"C:\\Users\\sag06\\Desktop\\project\\search-page\\client\\src\\Components\\Paginations.js":"1"},{"size":4208,"mtime":1612292675311,"results":"2","hashOfConfig":"3"},{"filePath":"4","messages":"5","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1n20xnc","C:\\Users\\sag06\\Desktop\\project\\search-page\\client\\src\\Components\\Paginations.js",[]]
[{
"C:
\\
Users
\\
sag06
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
Paginations.js"
:
"1"
,
"C:
\\
Users
\\
sag06
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Pages
\\
App.js"
:
"2"
,
"C:
\\
Users
\\
sag06
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Pages
\\
Bookmark.js"
:
"3"
,
"C:
\\
Users
\\
sag06
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Pages
\\
Place.js"
:
"4"
,
"C:
\\
Users
\\
sag06
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Pages
\\
Search.js"
:
"5"
,
"C:
\\
Users
\\
sag06
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Pages
\\
Login.js"
:
"6"
,
"C:
\\
Users
\\
sag06
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Pages
\\
Signup.js"
:
"7"
},{
"size"
:
4208
,
"mtime"
:
1612292675311
,
"results"
:
"8"
,
"hashOfConfig"
:
"9"
},{
"size"
:
5518
,
"mtime"
:
1612292988591
,
"results"
:
"10"
,
"hashOfConfig"
:
"9"
},{
"size"
:
5990
,
"mtime"
:
1612293001715
,
"results"
:
"11"
,
"hashOfConfig"
:
"9"
},{
"size"
:
3367
,
"mtime"
:
1612293099153
,
"results"
:
"12"
,
"hashOfConfig"
:
"9"
},{
"size"
:
6637
,
"mtime"
:
1612293100467
,
"results"
:
"13"
,
"hashOfConfig"
:
"9"
},{
"size"
:
3523
,
"mtime"
:
1612293531015
,
"results"
:
"14"
,
"hashOfConfig"
:
"9"
},{
"size"
:
3174
,
"mtime"
:
1612297063302
,
"results"
:
"15"
,
"hashOfConfig"
:
"9"
},{
"filePath"
:
"16"
,
"messages"
:
"17"
,
"errorCount"
:
0
,
"warningCount"
:
0
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
},
"1n20xnc"
,{
"filePath"
:
"18"
,
"messages"
:
"19"
,
"errorCount"
:
0
,
"warningCount"
:
0
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
},{
"filePath"
:
"20"
,
"messages"
:
"21"
,
"errorCount"
:
0
,
"warningCount"
:
2
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"source"
:
"22"
},{
"filePath"
:
"23"
,
"messages"
:
"24"
,
"errorCount"
:
0
,
"warningCount"
:
4
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"source"
:
null
},{
"filePath"
:
"25"
,
"messages"
:
"26"
,
"errorCount"
:
0
,
"warningCount"
:
2
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"source"
:
null
},{
"filePath"
:
"27"
,
"messages"
:
"28"
,
"errorCount"
:
0
,
"warningCount"
:
1
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"source"
:
null
},{
"filePath"
:
"29"
,
"messages"
:
"30"
,
"errorCount"
:
0
,
"warningCount"
:
0
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
},
"C:
\\
Users
\\
sag06
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
Paginations.js"
,[],
"C:
\\
Users
\\
sag06
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Pages
\\
App.js"
,[],
"C:
\\
Users
\\
sag06
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Pages
\\
Bookmark.js"
,[
"31"
,
"32"
],
"import React, { useState, useEffect } from 'react'
\r\n
import { Col, Card, Container, Row, Button, Image } from
\"
react-bootstrap
\"\r\n
import axios from
\"
axios
\"\r\n
import ohuh from '../ohuh-sm.PNG';
\r\n
import catchErrors from '../utils/catchErrors.js'
\r\n
import { isAuthenticated } from '../utils/auth'
\r\n
import * as Icon from 'react-bootstrap-icons';
\r\n
import { Link } from 'react-router-dom'
\r\n
import Paginations from '../Components/Paginations';
\r\n
import _ from 'lodash';
\r\n\r\n\r\n\r\n\r\n
function Bookmark() {\r
\n
const [error, setError] = useState('')
\r\n
const [bookmark, setBookmark] = useState([true, true, true, true])
\r\n
const [pagePlace, setpagePlace] = useState([])
\r\n
const [index, setIndex] = useState(1);
\r\n
const [endPage, setEndPage] = useState(1)
\r\n
const [bookmarkPlace, setBookmarkPlace] = useState([{ name:
\"
\"
, address:
\"
\"
, img:
\"
\"
}])
\r\n
const user = isAuthenticated()
\r\n\r\n
async function getBookmark() {\r
\n
try {\r
\n
const bookmarkArr = [];
\r\n
const response = await axios.get(`/api/users/bookmark?ID=${user}`)
\r\n
setBookmarkPlace(response.data.bookmark)
\r\n
} catch (err) {\r
\n
catchErrors(err, setError(err))
\r\n
console.log(
\"
북마크에러
\"
, error)
\r\n
}
\r\n
}
\r\n\r\n\r\n
async function handleBookmark(index) {\r
\n
if (!bookmark[index]) {\r
\n
console.log(bookmarkPlace[index])
\r\n
try {\r
\n
const response = await axios.put(`/api/users/bookmark?ID=${user}&place=${bookmarkPlace[index]._id}`)
\r\n
alert(response.data, '북마크가 저장되었습니다.')
\r\n
const showArr = bookmark
\r\n
showArr[index] = true
\r\n
setBookmark(showArr)
\r\n
console.log(
\"
bookmark=
\"
, bookmark)
\r\n
} catch (error) {\r
\n
catchErrors(error, setError)
\r\n
}
\r\n
} else {\r
\n
try {\r
\n
const response = await axios.delete(`/api/users/bookmark?ID=${user}&place=${bookmarkPlace[index]._id}`)
\r\n
alert(response.data, '저장된 북마크가 삭제되었습니다.')
\r\n
getBookmark()
\r\n
console.log(
\"
bookmark=
\"
, bookmark)
\r\n
} catch (error) {\r
\n
catchErrors(error, setError)
\r\n
}
\r\n
}
\r\n
}
\r\n\r\n
const handlePage = (num) => {\r
\n
setIndex(num);
\r\n
}
\r\n\r\n
\r\n
function paginate(items, pageNumber, itemNumber) {\r
\n
const startIndex = (pageNumber - 1) * itemNumber
\r\n\r\n
return _(items)
\r\n
.slice(startIndex)
\r\n
.take(itemNumber)
\r\n
.value();
\r\n
}
\r\n\r\n
useEffect(() => {\r
\n
getBookmark()
\r\n
}, [])
\r\n\r\n\r\n
useEffect(() => {\r
\n
setpagePlace(paginate(bookmarkPlace, index, 4))
\r\n
setEndPage(Math.ceil((bookmarkPlace.length / 4)))
\r\n
}, [bookmarkPlace, index])
\r\n\r\n
return (
\r\n
<Container>
\r\n
<Link to=
\"
/
\"
><Image style={{ margin:
\"
1%
\"
}} src=
{
ohuh
}
/></Link>
\r\n
<div className=
\"
d-flex align-items-center p-3 text-white bg-info rounded shadow-sm
\"
>
\r\n
<div >
\r\n
<h1 className=
\"
h6 mb-0 text-white
\"
>북마크</h1>
\r\n
</div>
\r\n
</div>
\r\n
<Row className=
\"
d-flex flex-wrap
\"
>
\r\n
{console.log(
\"
#####################33
\"
, bookmarkPlace)}
\r\n
{pagePlace.map((place, index) => {\r
\n
return (
\r\n
<Col key=
{
index
}
md=
{
6
}
>
\r\n
<Card border=
\"
info
\"
style={{ margin:
\"
2%
\"
}}>
\r\n\r\n
<Card.Header style={{ margin:
\"
0
\"
, fontSize: '200%', fontWeight: 'bold' }} >
\r\n
{user ?
\r\n
<Button
\r\n
style=
{
{marginRight:\"3%\"}
}
\r\n
variant={bookmark[index] ?
\"
info
\"
:
\"
light
\"
}
\r\n
onClick={() => handleBookmark(index, place)}>
\r\n
<Icon.BookmarkStarFill size=
{
35
}
/>
\r\n
{console.log(
\"
bookmark
\"
, bookmark)}
\r\n
{console.log(
\"
bookmark[index]
\"
, bookmark[index])}</Button> : null}
\r\n
{
place.name
}
\r\n
</Card.Header>
\r\n
<Card.Img variant=
\"
top
\"
style={{ padding:
\"
5%
\"
, width:
\"
100%
\"
, height:
\"
340px
\"
}} src=
{
place.img
}
/>
\r\n
<Card.Body >
\r\n
<Card.Text style={{ overflow: 'auto', fontSize: '150%', width: '100%', height:
\"
65px
\"
}} >
\r\n
{
place.address
}
</Card.Text>
\r\n
<Link to=
{
`/place?name=${place.name}&src=${place.img}&address=${place.address}`
}
>
\r\n
<Button variant=
\"
info
\"
>
{
place.name
}
자세히 살펴보기</Button>
\r\n
</Link>
\r\n
</Card.Body>
\r\n
</Card>
\r\n
</Col>
\r\n
)
\r\n
})}
\r\n
</Row>
\r\n
<Row className=
\"
mt-2 d-flex justify-content-center
\"
>
\r\n
<Paginations index=
{
index
}
endPage=
{
endPage
}
handlePage=
{
handlePage
}
></Paginations>
\r\n
</Row>
\r\n
</Container >
\r\n
)
\r\n
}
\r\n\r\n
export default Bookmark
\r\n\r\n\r\n
// async function handleSubmit(e){\r
\n
// setState(true); //버튼이 눌려서 handlesubmit이될때 setState값이 true로 바뀐다
\r\n
// try { //respons 서버에 post로 요청하여 데이터를 받아온다
\r\n
// const response = await axios.post('/api/users/bookmark', page)
\r\n
// setSuccess(true)
\r\n
// } catch (error) {\r
\n
// console.log(error)
\r\n
// catchErrors(error, setError)
\r\n
// }
\r\n
// }
\r\n\r\n
// useEffect(() => {\r
\n
// getBookmark(user)
\r\n
// }, [user])"
,
"C:
\\
Users
\\
sag06
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Pages
\\
Place.js"
,[
"33"
,
"34"
,
"35"
,
"36"
],
"C:
\\
Users
\\
sag06
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Pages
\\
Search.js"
,[
"37"
,
"38"
],
"C:
\\
Users
\\
sag06
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Pages
\\
Login.js"
,[
"39"
],
"C:
\\
Users
\\
sag06
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Pages
\\
Signup.js"
,[],{
"ruleId"
:
"40"
,
"severity"
:
1
,
"message"
:
"41"
,
"line"
:
26
,
"column"
:
19
,
"nodeType"
:
"42"
,
"messageId"
:
"43"
,
"endLine"
:
26
,
"endColumn"
:
30
},{
"ruleId"
:
"44"
,
"severity"
:
1
,
"message"
:
"45"
,
"line"
:
77
,
"column"
:
8
,
"nodeType"
:
"46"
,
"endLine"
:
77
,
"endColumn"
:
10
,
"suggestions"
:
"47"
},{
"ruleId"
:
"40"
,
"severity"
:
1
,
"message"
:
"48"
,
"line"
:
1
,
"column"
:
10
,
"nodeType"
:
"49"
,
"messageId"
:
"43"
,
"endLine"
:
1
,
"endColumn"
:
15
},{
"ruleId"
:
"40"
,
"severity"
:
1
,
"message"
:
"50"
,
"line"
:
11
,
"column"
:
10
,
"nodeType"
:
"42"
,
"messageId"
:
"43"
,
"endLine"
:
11
,
"endColumn"
:
15
},{
"ruleId"
:
"44"
,
"severity"
:
1
,
"message"
:
"51"
,
"line"
:
30
,
"column"
:
6
,
"nodeType"
:
"46"
,
"endLine"
:
30
,
"endColumn"
:
8
,
"suggestions"
:
"52"
},{
"ruleId"
:
"53"
,
"severity"
:
1
,
"message"
:
"54"
,
"line"
:
89
,
"column"
:
11
,
"nodeType"
:
"55"
,
"endLine"
:
89
,
"endColumn"
:
44
},{
"ruleId"
:
"40"
,
"severity"
:
1
,
"message"
:
"50"
,
"line"
:
22
,
"column"
:
12
,
"nodeType"
:
"42"
,
"messageId"
:
"43"
,
"endLine"
:
22
,
"endColumn"
:
17
},{
"ruleId"
:
"44"
,
"severity"
:
1
,
"message"
:
"56"
,
"line"
:
57
,
"column"
:
8
,
"nodeType"
:
"46"
,
"endLine"
:
57
,
"endColumn"
:
15
,
"suggestions"
:
"57"
},{
"ruleId"
:
"40"
,
"severity"
:
1
,
"message"
:
"58"
,
"line"
:
2
,
"column"
:
68
,
"nodeType"
:
"42"
,
"messageId"
:
"43"
,
"endLine"
:
2
,
"endColumn"
:
71
},
"no-unused-vars"
,
"'bookmarkArr' is assigned a value but never used."
,
"Identifier"
,
"unusedVar"
,
"react-hooks/exhaustive-deps"
,
"React Hook useEffect has a missing dependency: 'getBookmark'. Either include it or remove the dependency array."
,
"ArrayExpression"
,[
"59"
],
"'kakao' is defined but never used."
,
"Program"
,
"'error' is assigned a value but never used."
,
"React Hook useEffect has a missing dependency: 'getReview'. Either include it or remove the dependency array."
,[
"60"
],
"jsx-a11y/anchor-is-valid"
,
"The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md"
,
"JSXOpeningElement"
,
"React Hook useEffect has missing dependencies: 'getAssociation', 'getBookmark', 'props.history', and 'search'. Either include them or remove the dependency array."
,[
"61"
],
"'Nav' is defined but never used."
,{
"desc"
:
"62"
,
"fix"
:
"63"
},{
"desc"
:
"64"
,
"fix"
:
"65"
},{
"desc"
:
"66"
,
"fix"
:
"67"
},
"Update the dependencies array to be: [getBookmark]"
,{
"range"
:
"68"
,
"text"
:
"69"
},
"Update the dependencies array to be: [getReview]"
,{
"range"
:
"70"
,
"text"
:
"71"
},
"Update the dependencies array to be: [getAssociation, getBookmark, props.history, search, state]"
,{
"range"
:
"72"
,
"text"
:
"73"
},[
2593
,
2595
],
"[getBookmark]"
,[
1055
,
1057
],
"[getReview]"
,[
2098
,
2105
],
"[getAssociation, getBookmark, props.history, search, state]"
]
\ No newline at end of file
\ No newline at end of file
client/src/Pages/App.js
View file @
2f8421dd
...
@@ -102,7 +102,7 @@ function App() {
...
@@ -102,7 +102,7 @@ function App() {
<
Col
md
=
{
6
}
xs
=
{
12
}
>
<
Col
md
=
{
6
}
xs
=
{
12
}
>
<
Card
border
=
"
info
"
style
=
{{
margin
:
"
2%
"
}}
>
<
Card
border
=
"
info
"
style
=
{{
margin
:
"
2%
"
}}
>
<
Card
.
Title
style
=
{{
margin
:
"
0
"
,
paddingTop
:
"
3%
"
,
fontSize
:
'
200%
'
,
fontWeight
:
'
bold
'
}}
>
<
Card
.
Title
style
=
{{
margin
:
"
0
"
,
paddingTop
:
"
3%
"
,
fontSize
:
'
200%
'
,
fontWeight
:
'
bold
'
}}
>
<
Row
style
=
{{
fontSize
:
"
60%
"
,
marginLeft
:
"
7%
"
}}
><
strong
class
=
"
border p-2 text-danger mb-2
"
>
인기관광지
<
/strong></
Row
>
<
Row
style
=
{{
fontSize
:
"
60%
"
,
marginLeft
:
"
7%
"
}}
><
strong
class
Name
=
"
border p-2 text-danger mb-2
"
>
인기관광지
<
/strong></
Row
>
<
Row
style
=
{{
fontSize
:
"
100%
"
,
marginLeft
:
"
8%
"
}}
>
{
recommend
.
name
}
<
/Row></
Card
.
Title
>
<
Row
style
=
{{
fontSize
:
"
100%
"
,
marginLeft
:
"
8%
"
}}
>
{
recommend
.
name
}
<
/Row></
Card
.
Title
>
<
Card
.
Img
variant
=
"
top
"
style
=
{{
padding
:
"
5%
"
,
width
:
"
100%
"
,
height
:
"
340px
"
}}
src
=
{
recommend
.
img
}
/
>
<
Card
.
Img
variant
=
"
top
"
style
=
{{
padding
:
"
5%
"
,
width
:
"
100%
"
,
height
:
"
340px
"
}}
src
=
{
recommend
.
img
}
/
>
<
Card
.
Body
style
=
{{
paddingTop
:
"
0
"
}}
>
<
Card
.
Body
style
=
{{
paddingTop
:
"
0
"
}}
>
...
@@ -118,7 +118,7 @@ function App() {
...
@@ -118,7 +118,7 @@ function App() {
<
Col
md
=
{
6
}
xs
=
{
12
}
>
<
Col
md
=
{
6
}
xs
=
{
12
}
>
<
Card
border
=
"
info
"
style
=
{{
margin
:
"
2%
"
}}
>
<
Card
border
=
"
info
"
style
=
{{
margin
:
"
2%
"
}}
>
<
Card
.
Title
style
=
{{
margin
:
"
0
"
,
paddingTop
:
"
3%
"
,
fontSize
:
'
200%
'
,
fontWeight
:
'
bold
'
}}
>
<
Card
.
Title
style
=
{{
margin
:
"
0
"
,
paddingTop
:
"
3%
"
,
fontSize
:
'
200%
'
,
fontWeight
:
'
bold
'
}}
>
<
Row
style
=
{{
fontSize
:
"
60%
"
,
marginLeft
:
"
7%
"
}}
><
strong
class
=
"
border p-2 text-success mb-2
"
>
최근
검색
관광지
<
/strong></
Row
>
<
Row
style
=
{{
fontSize
:
"
60%
"
,
marginLeft
:
"
7%
"
}}
><
strong
class
Name
=
"
border p-2 text-success mb-2
"
>
최근
검색
관광지
<
/strong></
Row
>
<
Row
style
=
{{
fontSize
:
"
100%
"
,
marginLeft
:
"
8%
"
}}
>
{
latest
.
name
}
<
/Row></
Card
.
Title
>
<
Row
style
=
{{
fontSize
:
"
100%
"
,
marginLeft
:
"
8%
"
}}
>
{
latest
.
name
}
<
/Row></
Card
.
Title
>
<
Card
.
Img
variant
=
"
top
"
style
=
{{
padding
:
"
5%
"
,
width
:
"
100%
"
,
height
:
"
340px
"
}}
src
=
{
latest
.
img
}
/
>
<
Card
.
Img
variant
=
"
top
"
style
=
{{
padding
:
"
5%
"
,
width
:
"
100%
"
,
height
:
"
340px
"
}}
src
=
{
latest
.
img
}
/
>
<
Card
.
Body
style
=
{{
paddingTop
:
"
0
"
}}
>
<
Card
.
Body
style
=
{{
paddingTop
:
"
0
"
}}
>
...
...
client/src/Pages/Bookmark.js
View file @
2f8421dd
...
@@ -85,9 +85,9 @@ function Bookmark() {
...
@@ -85,9 +85,9 @@ function Bookmark() {
return
(
return
(
<
Container
>
<
Container
>
<
Link
to
=
"
/
"
><
Image
style
=
{{
margin
:
"
1%
"
}}
src
=
{
ohuh
}
/></
Link
>
<
Link
to
=
"
/
"
><
Image
style
=
{{
margin
:
"
1%
"
}}
src
=
{
ohuh
}
/></
Link
>
<
div
class
=
"
d-flex align-items-center p-3 text-white bg-info rounded shadow-sm
"
>
<
div
class
Name
=
"
d-flex align-items-center p-3 text-white bg-info rounded shadow-sm
"
>
<
div
>
<
div
>
<
h1
class
=
"
h6 mb-0 text-white
"
>
북마크
<
/h1
>
<
h1
class
Name
=
"
h6 mb-0 text-white
"
>
북마크
<
/h1
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
Row
className
=
"
d-flex flex-wrap
"
>
<
Row
className
=
"
d-flex flex-wrap
"
>
...
...
client/src/
Component
s/Login.js
→
client/src/
Page
s/Login.js
View file @
2f8421dd
import
React
,
{
useState
,
useEffect
}
from
'
react
'
import
React
,
{
useState
,
useEffect
}
from
'
react
'
import
{
Alert
,
Col
,
Container
,
Form
,
Row
,
Button
,
Spinner
}
from
"
react-bootstrap
"
import
{
Alert
,
Col
,
Container
,
Form
,
Row
,
Button
,
Spinner
,
Image
,
Nav
,
Navbar
}
from
"
react-bootstrap
"
import
axios
from
"
axios
"
import
axios
from
"
axios
"
import
catchErrors
from
'
../utils/catchErrors
'
import
catchErrors
from
'
../utils/catchErrors
'
import
{
Redirect
}
from
'
react-router-dom
'
import
{
Redirect
}
from
'
react-router-dom
'
import
{
handleLogin
}
from
'
../utils/auth
'
import
{
handleLogin
}
from
'
../utils/auth
'
import
{
Link
}
from
'
react-router-dom
'
;
import
ohuh
from
'
../ohuh-sm.PNG
'
;
const
INIT_USER
=
{
const
INIT_USER
=
{
email
:
''
,
email
:
''
,
...
@@ -52,7 +53,10 @@ function Login() {
...
@@ -52,7 +53,10 @@ function Login() {
return
(
return
(
<
Container
>
<
Container
>
<
Row
className
=
'
vh-100 flex-column align-items-center justify-content-center
'
>
<
Navbar
bg
=
"
#fff
"
variant
=
"
light
"
>
<
Navbar
.
Brand
href
=
"
/
"
><
Image
src
=
{
ohuh
}
/></
Navbar
.
Brand
>
<
/Navbar
>
<
Row
className
=
'
mt-3 flex-column align-items-center justify-content-center
'
>
<
h2
>
로그인
<
/h2
>
<
h2
>
로그인
<
/h2
>
<
Col
md
=
{
6
}
>
<
Col
md
=
{
6
}
>
{
error
&&
<
Alert
variant
=
'
danger
'
>
{
error
&&
<
Alert
variant
=
'
danger
'
>
...
@@ -67,10 +71,13 @@ function Login() {
...
@@ -67,10 +71,13 @@ function Login() {
<
Form
.
Label
>
비밀번호
<
/Form.Label
>
<
Form
.
Label
>
비밀번호
<
/Form.Label
>
<
Form
.
Control
name
=
'
password
'
type
=
'
password
'
value
=
{
user
.
password
}
onChange
=
{
handleChange
}
/
>
<
Form
.
Control
name
=
'
password
'
type
=
'
password
'
value
=
{
user
.
password
}
onChange
=
{
handleChange
}
/
>
<
/Form.Group
>
<
/Form.Group
>
<
Button
disabled
=
{
disabled
||
setLoading
}
type
=
'
submit
'
<
Button
variant
=
"
info
"
disabled
=
{
disabled
||
setLoading
}
type
=
'
submit
'
block
>
block
>
{
loading
&&
<
Spinner
as
=
'
span
'
animation
=
'
border
'
size
=
'
sm
'
{
loading
&&
<
Spinner
as
=
'
span
'
animation
=
'
border
'
size
=
'
sm
'
role
=
'
status
'
aria
-
hidden
=
'
true
'
/>
}{
'
'
}
확인
<
/Button
>
role
=
'
status
'
aria
-
hidden
=
'
true
'
/>
}{
'
'
}
확인
<
/Button
>
<
Link
to
=
'
/signup
'
>
회원이
아니신가요
?
<
/Link
>
<
/Form
>
<
/Form
>
<
/Col
>
<
/Col
>
<
/Row
>
<
/Row
>
...
...
client/src/Pages/Place.js
View file @
2f8421dd
...
@@ -34,49 +34,49 @@ function Place(props) {
...
@@ -34,49 +34,49 @@ function Place(props) {
<
Container
>
<
Container
>
<
Link
to
=
"
/
"
><
Image
style
=
{{
margin
:
"
1%
"
}}
src
=
{
ohuh
}
/></
Link
>
<
Link
to
=
"
/
"
><
Image
style
=
{{
margin
:
"
1%
"
}}
src
=
{
ohuh
}
/></
Link
>
<
div
class
=
"
d-flex align-items-center p-3 my-3 text-white bg-info rounded shadow-sm
"
>
<
div
class
Name
=
"
d-flex align-items-center p-3 my-3 text-white bg-info rounded shadow-sm
"
>
<
h1
class
=
"
h6 mb-0 text-white
"
>
{
name
}
<
/h1
>
<
h1
class
Name
=
"
h6 mb-0 text-white
"
>
{
name
}
<
/h1
>
<
/div
>
<
/div
>
<
div
class
=
"
my-3 p-3 bg-white rounded shadow-sm
"
>
<
div
class
Name
=
"
my-3 p-3 bg-white rounded shadow-sm
"
>
<
h6
class
=
"
border-bottom pb-2 mb-0
"
>
관광지
정보
<
/h6
>
<
h6
class
Name
=
"
border-bottom pb-2 mb-0
"
>
관광지
정보
<
/h6
>
<
Row
>
<
Row
>
<
Col
>
<
Col
>
<
Image
variant
=
"
top
"
style
=
{{
padding
:
"
5%
"
,
width
:
"
100%
"
,
height
:
"
100%
"
}}
src
=
{
src
}
/
>
<
Image
variant
=
"
top
"
style
=
{{
padding
:
"
5%
"
,
width
:
"
100%
"
,
height
:
"
100%
"
}}
src
=
{
src
}
/
>
<
/Col
>
<
/Col
>
<
Col
>
<
Col
>
<
div
class
=
"
d-flex text-muted pt-3
"
>
<
div
class
Name
=
"
d-flex text-muted pt-3
"
>
<
p
class
=
"
pb-3 mb-0 lh-sm border-bottom
"
>
<
p
class
Name
=
"
pb-3 mb-0 lh-sm border-bottom
"
>
<
strong
class
=
"
d-block text-gray-dark
"
>
관광지
이름
<
/strong
>
<
strong
class
Name
=
"
d-block text-gray-dark
"
>
관광지
이름
<
/strong
>
{
name
}
{
name
}
<
/p
>
<
/p
>
<
/div
>
<
/div
>
<
div
class
=
"
d-flex text-muted pt-3
"
>
<
div
class
Name
=
"
d-flex text-muted pt-3
"
>
<
p
class
=
"
pb-3 mb-0 lh-sm border-bottom
"
>
<
p
class
Name
=
"
pb-3 mb-0 lh-sm border-bottom
"
>
<
strong
class
=
"
d-block text-gray-dark
"
>
관광지
주소
<
/strong
>
<
strong
class
Name
=
"
d-block text-gray-dark
"
>
관광지
주소
<
/strong
>
{
address
}
{
address
}
<
/p
>
<
/p
>
<
/div
>
<
/div
>
<
/Col
>
<
/Col
>
<
/Row
>
<
/Row
>
<
small
class
=
"
d-block text-end mt-3
"
>
<
small
class
Name
=
"
d-block text-end mt-3
"
>
<
a
href
=
{
`https://www.google.com/search?q=
${
name
}
&tbm=isch`
}
>
사진
더보러가기
<
/a
>
<
a
href
=
{
`https://www.google.com/search?q=
${
name
}
&tbm=isch`
}
>
사진
더보러가기
<
/a
>
<
/small
>
<
/small
>
<
/div
>
<
/div
>
<
div
class
=
"
my-3 p-3 bg-white rounded shadow-sm
"
>
<
div
class
Name
=
"
my-3 p-3 bg-white rounded shadow-sm
"
>
<
h6
class
=
"
border-bottom pb-2 mb-0
"
>
관광지
후기
<
/h6
>
<
h6
class
Name
=
"
border-bottom pb-2 mb-0
"
>
관광지
후기
<
/h6
>
{
Array
.
isArray
(
review
.
reviews
)
?
review
.
reviews
.
map
((
review
)
=>
{
{
Array
.
isArray
(
review
.
reviews
)
?
review
.
reviews
.
map
((
review
)
=>
{
return
(
return
(
<
div
class
=
"
d-flex text-muted pt-3
"
>
<
div
class
Name
=
"
d-flex text-muted pt-3
"
>
<
div
class
=
"
pb-3 mb-0 small lh-sm border-bottom w-100
"
>
<
div
class
Name
=
"
pb-3 mb-0 small lh-sm border-bottom w-100
"
>
<
div
class
=
"
d-flex justify-content-between
"
>
<
div
class
Name
=
"
d-flex justify-content-between
"
>
<
strong
class
=
"
text-gray-dark
"
>
{
review
.
title
}
<
/strong
>
<
strong
class
Name
=
"
text-gray-dark
"
>
{
review
.
title
}
<
/strong
>
<
a
href
=
{
review
.
link
}
>
블로그로
이동
<
/a
>
<
a
href
=
{
review
.
link
}
>
블로그로
이동
<
/a
>
<
/div
>
<
/div
>
<
span
class
=
"
d-block
"
>
{
review
.
summary
}
<
/span
>
<
span
class
Name
=
"
d-block
"
>
{
review
.
summary
}
<
/span
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)
)
...
@@ -85,7 +85,7 @@ function Place(props) {
...
@@ -85,7 +85,7 @@ function Place(props) {
<
small
class
=
"
d-block text-end mt-3
"
>
<
small
class
Name
=
"
d-block text-end mt-3
"
>
<
a
href
=
"
#
"
onClick
=
{
getReview
}
>
리뷰
더보기
<
/a
>
<
a
href
=
"
#
"
onClick
=
{
getReview
}
>
리뷰
더보기
<
/a
>
<
/small
>
<
/small
>
<
/div
>
<
/div
>
...
...
client/src/Pages/Search.js
View file @
2f8421dd
...
@@ -103,7 +103,7 @@ function Search(props) {
...
@@ -103,7 +103,7 @@ function Search(props) {
return
(
return
(
<
Container
>
<
Container
>
<
Link
to
=
"
/
"
><
Image
src
=
{
ohuh
}
/></
Link
>
<
Link
to
=
"
/
"
><
Image
src
=
{
ohuh
}
/></
Link
>
<
Row
className
=
"
mb-2
"
className
=
"
d-flex justify-content-center
"
>
<
Row
className
=
"
mb-2
d-flex justify-content-center
"
>
<
Form
style
=
{{
width
:
"
90vw
"
}}
onSubmit
=
{
handleSubmit
}
>
<
Form
style
=
{{
width
:
"
90vw
"
}}
onSubmit
=
{
handleSubmit
}
>
<
InputGroup
size
=
"
lg
"
>
<
InputGroup
size
=
"
lg
"
>
<
FormControl
<
FormControl
...
...
client/src/
Component
s/Signup.js
→
client/src/
Page
s/Signup.js
View file @
2f8421dd
import
React
,
{
useState
,
useEffect
}
from
'
react
'
import
React
,
{
useState
,
useEffect
}
from
'
react
'
import
{
Col
,
Container
,
Form
,
Row
,
Button
,
Alert
}
from
"
react-bootstrap
"
import
{
Col
,
Container
,
Form
,
Row
,
Button
,
Alert
,
Image
,
Navbar
}
from
"
react-bootstrap
"
import
axios
from
"
axios
"
import
axios
from
"
axios
"
import
catchErrors
from
'
../utils/catchErrors
'
import
catchErrors
from
'
../utils/catchErrors
'
import
{
Redirect
}
from
'
react-router-dom
'
import
{
Redirect
}
from
'
react-router-dom
'
import
ohuh
from
'
../ohuh-sm.PNG
'
;
const
INIT_USER
=
{
const
INIT_USER
=
{
name
:
''
,
name
:
''
,
...
@@ -47,7 +48,10 @@ function Signup() {
...
@@ -47,7 +48,10 @@ function Signup() {
return
(
return
(
<
Container
>
<
Container
>
<
Row
className
=
'
vh-100 flex-column align-items-center justify-content-center
'
>
<
Navbar
bg
=
"
#fff
"
variant
=
"
light
"
>
<
Navbar
.
Brand
href
=
"
/
"
><
Image
src
=
{
ohuh
}
/></
Navbar
.
Brand
>
<
/Navbar
>
<
Row
className
=
'
mt-3 flex-column align-items-center justify-content-center
'
>
<
h2
>
회원가입
<
/h2
>
<
h2
>
회원가입
<
/h2
>
<
Col
md
=
{
5
}
>
<
Col
md
=
{
5
}
>
{
error
&&
<
Alert
variant
=
'
danger
'
>
{
error
&&
<
Alert
variant
=
'
danger
'
>
...
@@ -66,7 +70,7 @@ function Signup() {
...
@@ -66,7 +70,7 @@ function Signup() {
<
Form
.
Label
>
비밀번호
<
/Form.Label
>
<
Form
.
Label
>
비밀번호
<
/Form.Label
>
<
Form
.
Control
name
=
'
password
'
type
=
'
password
'
value
=
{
user
.
password
}
onChange
=
{
handleChange
}
/
>
<
Form
.
Control
name
=
'
password
'
type
=
'
password
'
value
=
{
user
.
password
}
onChange
=
{
handleChange
}
/
>
<
/Form.Group
>
<
/Form.Group
>
<
Button
disabled
=
{
disabled
}
type
=
'
submit
'
block
>
확인
<
/Button
>
<
Button
variant
=
"
info
"
disabled
=
{
disabled
}
type
=
'
submit
'
block
>
확인
<
/Button
>
<
/Form
>
<
/Form
>
<
/Col
>
<
/Col
>
<
/Row
>
<
/Row
>
...
...
client/src/index.js
View file @
2f8421dd
...
@@ -5,8 +5,8 @@ import 'bootstrap/dist/css/bootstrap.min.css';
...
@@ -5,8 +5,8 @@ import 'bootstrap/dist/css/bootstrap.min.css';
import
App
from
'
./Pages/App
'
import
App
from
'
./Pages/App
'
import
Search
from
'
./Pages/Search
'
;
import
Search
from
'
./Pages/Search
'
;
import
reportWebVitals
from
'
./reportWebVitals
'
;
import
reportWebVitals
from
'
./reportWebVitals
'
;
import
Signup
from
'
./
Component
s/Signup
'
import
Signup
from
'
./
Page
s/Signup
'
import
Login
from
'
./
Component
s/Login
'
import
Login
from
'
./
Page
s/Login
'
import
PrivateRoute
from
"
./Components/PrivateRoute
"
;
import
PrivateRoute
from
"
./Components/PrivateRoute
"
;
import
Bookmark
from
"
./Pages/Bookmark
"
import
Bookmark
from
"
./Pages/Bookmark
"
import
{
import
{
...
@@ -24,9 +24,9 @@ ReactDOM.render(
...
@@ -24,9 +24,9 @@ ReactDOM.render(
<
Route
exact
path
=
"
/
"
component
=
{
App
}
/
>
<
Route
exact
path
=
"
/
"
component
=
{
App
}
/
>
<
Route
path
=
"
/search
"
component
=
{
Search
}
/
>
<
Route
path
=
"
/search
"
component
=
{
Search
}
/
>
<
Route
path
=
"
/place
"
component
=
{
Place
}
/
>
<
Route
path
=
"
/place
"
component
=
{
Place
}
/
>
<
Route
path
=
'
/signup
'
component
=
{
Signup
}
/
>
<
Route
path
=
'
/signup
'
component
=
{
Signup
}
/
>
<
Route
path
=
'
/login
'
component
=
{
Login
}
/
>
<
Route
path
=
'
/login
'
component
=
{
Login
}
/
>
<
PrivateRoute
path
=
'
/bookmark
'
><
Bookmark
/><
/PrivateRoute
>
<
PrivateRoute
path
=
'
/bookmark
'
><
Bookmark
/><
/PrivateRoute
>
<
Redirect
path
=
"
/search
"
to
=
"
/search
"
/>
<
Redirect
path
=
"
/search
"
to
=
"
/search
"
/>
<
/Switch
>
<
/Switch
>
<
/Router
>
<
/Router
>
...
...
server/models/Review.js
View file @
2f8421dd
...
@@ -19,10 +19,6 @@ const ReviewSchema = new mongoose.Schema({
...
@@ -19,10 +19,6 @@ const ReviewSchema = new mongoose.Schema({
type
:
Array
,
type
:
Array
,
// required: true,
// required: true,
},
},
time
:
{
type
:
Array
,
// required: true,
},
},
{
},
{
timestamps
:
true
timestamps
:
true
})
})
...
...
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