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
c368c2c6
Commit
c368c2c6
authored
Jan 30, 2021
by
Lee SeoYeon
Browse files
.
parent
d0ed12bb
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
client/.eslintcache
View file @
c368c2c6
This diff is collapsed.
Click to expand it.
client/src/Pages/App.js
View file @
c368c2c6
...
...
@@ -61,7 +61,7 @@ function App() {
<
/Row
>
<
Row
style
=
{{
marginBottom
:
"
5%
"
}}
>
<
Form
className
=
"
vw-100
"
onSubmit
=
{
handleSubmit
}
>
<
InputGroup
style
=
{{
width
:
560
}}
>
<
InputGroup
>
<
Form
.
Control
size
=
"
lg
"
placeholder
=
"
검색어를 입력하세요.
"
...
...
client/src/Pages/Search.js
View file @
c368c2c6
...
...
@@ -89,28 +89,6 @@ function Search(props) {
}
const
places
=
[{
name
:
"
한라산
"
,
address
:
"
제주 서귀포시 토평동 산15-1
"
,
img
:
"
https://upload.wikimedia.org/wikipedia/commons/thumb/e/eb/KOCIS_Halla_Mountain_in_Jeju-do_%286387785543%29.jpg/269px-KOCIS_Halla_Mountain_in_Jeju-do_%286387785543%29.jpg?size=200x200
"
,
},
{
name
:
"
성산일출봉(sungsan)
"
,
address
:
"
제주 서귀포시 성산읍 성산리 1
"
,
img
:
"
https://www.jeju.go.kr/pub/site/geopark/images/sub/sub03/02%EC%A7%80%EC%A7%88%EB%A7%88%EC%9D%84%EC%9D%B4%EC%95%BC%EA%B8%B0/%EC%A7%80%EC%A7%88%EB%A7%88%EC%9D%84/%EC%A7%80%EC%A7%88%EB%A7%88%EC%9D%84_%EC%84%B1%EC%82%B0%EC%9D%BC%EC%B6%9C%EB%B4%89/1412402261.jpg?400/400
"
,
},
{
name
:
"
해녀의 집(haenyeo)
"
,
address
:
"
제주 서귀포시 성산읍 한도로 141-13지번오조리 3 오조해녀의집
"
,
img
:
"
https://mblogthumb-phinf.pstatic.net/MjAxNjExMTdfMTc0/MDAxNDc5MzU3ODU0ODQy.KZYXCjzsXT3rCsE4HXBfxyCg2buvluBvN_7NxVp7BSwg.loJc89d8JjGXdNCn-4yMd7aMWPjfrZn21TI9Hyzemkog.JPEG.icocam11/20161010_100205.jpg?type=w800
"
,
},
{
name
:
"
오설록 티 뮤지엄(osulloc)
"
,
address
:
"
제주 서귀포시 안덕면 신화역사로 15 오설록지번서광리 1235-1 오설록
"
,
img
:
"
https://cdnweb01.wikitree.co.kr/webdata/editor/202007/01/img_20200701143323_2ced7627.webp
"
,
},
{
name
:
"
오설록 티 뮤지엄(osulloc)
"
,
address
:
"
제주 서귀포시 안덕면 신화역사로 15 오설록지번서광리 1235-1 오설록
"
,
img
:
"
https://upload.wikimedia.org/wikipedia/commons/thumb/e/eb/KOCIS_Halla_Mountain_in_Jeju-do_%286387785543%29.jpg/269px-KOCIS_Halla_Mountain_in_Jeju-do_%286387785543%29.jpg
"
,
}]
if
(
state
!==
false
)
{
// console.log(queryString.parse(props.location.search))
// = {keyword:search}
...
...
@@ -160,7 +138,7 @@ function Search(props) {
const
showArr
=
bookmark
showArr
[
index
]
=
true
setBookmark
(
showArr
)
console
.
log
(
"
bookmark=
"
,
bookmark
)
console
.
log
(
"
bookmark=
"
,
bookmark
)
}
catch
(
error
)
{
catchErrors
(
error
,
setError
)
}
...
...
@@ -215,8 +193,7 @@ function Search(props) {
variant
=
{
bookmark
[
index
]
?
"
primary
"
:
"
light
"
}
onClick
=
{()
=>
handlebookmark
(
index
,
place
)}
>
<
Icon
.
BookmarkStarFill
size
=
{
35
}
/
>
{
console
.
log
(
"
bookmark
"
,
bookmark
)}
{
console
.
log
(
"
bookmark[index]
"
,
bookmark
[
index
])}
<
/Button> : null
}
<
/Button> : null
}
<
/Card.Title
>
<
Card
.
Img
variant
=
"
top
"
style
=
{{
padding
:
"
5%
"
,
width
:
"
100%
"
,
height
:
"
340px
"
}}
src
=
{
place
.
img
}
/
>
<
Card
.
Body
>
...
...
server/controllers/place.controller.js
View file @
c368c2c6
import
Places
from
'
../models/Place.js
'
import
cheerio
from
'
cheerio
'
import
fs
from
'
fs
'
import
axios
from
'
axios
'
;
import
{
nextTick
}
from
'
process
'
;
const
searchPlace
=
async
(
req
,
res
,
next
,)
=>
{
...
...
@@ -23,7 +25,9 @@ const searchPlace = async (req, res, next,) => {
})
req
.
places
=
places
}
next
()
}
const
searchImg
=
async
(
req
,
res
,
next
)
=>
{
...
...
@@ -46,10 +50,12 @@ const searchImg = async (req, res, next) => {
req
.
places
.
times
.
push
(
new
Date
().
toLocaleString
())
const
newPlaces
=
await
new
Places
(
req
.
places
).
save
()
next
()
})
}
else
{
console
.
log
(
"
이미지 생성 오류발생!!
"
)
}
}
const
searchAssociation
=
async
(
req
,
res
)
=>
{
let
Place3
=
req
.
places
.
address
...
...
@@ -58,7 +64,6 @@ const searchAssociation = async (req, res) => {
}
else
{
let
addresse
=
Place3
.
split
(
'
'
)[
0
]
let
AssociationsId
=
[]
let
addressPlaces
=
new
RegExp
(
`
${
addresse
}
`
)
let
responsePlaces
=
await
Places
.
find
({
address
:
addressPlaces
}).
sort
({
updatedAt
:
-
1
})
res
.
send
(
responsePlaces
)
...
...
@@ -66,4 +71,4 @@ const searchAssociation = async (req, res) => {
}
export
default
{
searchImg
,
searchPlace
,
searchAssociation
}
export
default
{
searchImg
,
searchPlace
,
searchAssociation
}
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