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
8f6994e2
Commit
8f6994e2
authored
Jan 24, 2021
by
Lee SeoYeon
Browse files
.
parent
8c182ca7
Changes
1
Hide whitespace changes
Inline
Side-by-side
client/.eslintcache
View file @
8f6994e2
[{
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
index.js"
:
"1"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
reportWebVitals.js"
:
"2"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
Place.js"
:
"3"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
Login.js"
:
"4"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
utils
\\
catchErrors.js"
:
"5"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
Signup.js"
:
"6"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
utils
\\
auth.js"
:
"7"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
Paginations.js"
:
"8"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Search.js"
:
"9"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
App.js"
:
"10"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
PrivateRoute.js"
:
"11"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Bookmark.js"
:
"12"
},{
"size"
:
1368
,
"mtime"
:
1611270972548
,
"results"
:
"13"
,
"hashOfConfig"
:
"14"
},{
"size"
:
362
,
"mtime"
:
499162500000
,
"results"
:
"15"
,
"hashOfConfig"
:
"14"
},{
"size"
:
1586
,
"mtime"
:
1611491429445
,
"results"
:
"16"
,
"hashOfConfig"
:
"14"
},{
"size"
:
3075
,
"mtime"
:
1611489617094
,
"results"
:
"17"
,
"hashOfConfig"
:
"14"
},{
"size"
:
405
,
"mtime"
:
1609915408569
,
"results"
:
"18"
,
"hashOfConfig"
:
"14"
},{
"size"
:
2995
,
"mtime"
:
1611489922054
,
"results"
:
"19"
,
"hashOfConfig"
:
"14"
},{
"size"
:
670
,
"mtime"
:
1611493895142
,
"results"
:
"20"
,
"hashOfConfig"
:
"14"
},{
"size"
:
2199
,
"mtime"
:
1610503781980
,
"results"
:
"21"
,
"hashOfConfig"
:
"14"
},{
"size"
:
11142
,
"mtime"
:
1611489922078
,
"results"
:
"22"
,
"hashOfConfig"
:
"14"
},{
"size"
:
2110
,
"mtime"
:
1611491700525
,
"results"
:
"23"
,
"hashOfConfig"
:
"14"
},{
"size"
:
486
,
"mtime"
:
1611489922054
,
"results"
:
"24"
,
"hashOfConfig"
:
"14"
},{
"size"
:
2226
,
"mtime"
:
1611489922053
,
"results"
:
"25"
,
"hashOfConfig"
:
"14"
},{
"filePath"
:
"26"
,
"messages"
:
"27"
,
"errorCount"
:
0
,
"warningCount"
:
0
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"usedDeprecatedRules"
:
"28"
},
"1t9w6go"
,{
"filePath"
:
"29"
,
"messages"
:
"30"
,
"errorCount"
:
0
,
"warningCount"
:
0
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"usedDeprecatedRules"
:
"28"
},{
"filePath"
:
"31"
,
"messages"
:
"32"
,
"errorCount"
:
0
,
"warningCount"
:
6
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"source"
:
"33"
,
"usedDeprecatedRules"
:
"28"
},{
"filePath"
:
"34"
,
"messages"
:
"35"
,
"errorCount"
:
0
,
"warningCount"
:
0
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"usedDeprecatedRules"
:
"28"
},{
"filePath"
:
"36"
,
"messages"
:
"37"
,
"errorCount"
:
0
,
"warningCount"
:
0
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"usedDeprecatedRules"
:
"28"
},{
"filePath"
:
"38"
,
"messages"
:
"39"
,
"errorCount"
:
0
,
"warningCount"
:
0
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"usedDeprecatedRules"
:
"28"
},{
"filePath"
:
"40"
,
"messages"
:
"41"
,
"errorCount"
:
0
,
"warningCount"
:
0
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
},{
"filePath"
:
"42"
,
"messages"
:
"43"
,
"errorCount"
:
0
,
"warningCount"
:
0
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"usedDeprecatedRules"
:
"28"
},{
"filePath"
:
"44"
,
"messages"
:
"45"
,
"errorCount"
:
0
,
"warningCount"
:
10
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"source"
:
"46"
,
"usedDeprecatedRules"
:
"28"
},{
"filePath"
:
"47"
,
"messages"
:
"48"
,
"errorCount"
:
0
,
"warningCount"
:
4
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"source"
:
"49"
,
"usedDeprecatedRules"
:
"28"
},{
"filePath"
:
"50"
,
"messages"
:
"51"
,
"errorCount"
:
0
,
"warningCount"
:
0
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"usedDeprecatedRules"
:
"28"
},{
"filePath"
:
"52"
,
"messages"
:
"53"
,
"errorCount"
:
0
,
"warningCount"
:
14
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"source"
:
"54"
,
"usedDeprecatedRules"
:
"28"
},
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
index.js"
,[],[
"55"
,
"56"
],
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
reportWebVitals.js"
,[],
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
Place.js"
,[
"57"
,
"58"
,
"59"
,
"60"
,
"61"
,
"62"
],
"import axios from 'axios';
\r\n
import React, { useEffect, useState } from 'react';
\r\n
import { Modal, Container, Row, Button, } from 'react-bootstrap';
\r\n\r\n
function Place(props) {\r
\n
<<<<<<< HEAD
\r\n
const [reviews, setReviews] = useState([])
\r\n
const getReview = () => { //review를 서버에 연결해서
\r\n
axios.get(`/api/review/${props.search.name}`)
\r\n
=======
\r\n
const [reviews, setReviews] = useState([{ title:
\"\"
, link:
\"\"
, summery:
\"\"
, content:
\"\"
}])
\r\n
const getReview = () => {\r
\n
axios.get(`/api/review/${props.search.name}`)
\r\n
>>>>>>> origin/BAE
\r\n
.then(res => {\r
\n
console.log(
\"
place res.data
\"
, res.data)
\r\n
setReviews(res.data)
\r\n
})
\r\n
.catch(err => {\r
\n
console.log(err)
\r\n
})
\r\n
}
\r\n\r\n
useEffect(() => {\r
\n
getReview();
\r\n
}, [])
\r\n\r\n
return (
\r\n
<Modal
{
...props
}
\r\n
size=
\"
xl
\"\r\n
keyboard=
\"
true
\"\r\n
variant=
\"
backdrop.in
\"\r\n
aria-labelledby=
\"
example-modal-sizes-title-lg
\"
>
\r\n
<Modal.Header closeButton>
\r\n
<Modal.Title id=
\"
contained-modal-title-vcenter
\"
style={{ fontSize: '40px' }}>
\r\n
{props.index + 1}.
{
props.search.name
}
\r\n
</Modal.Title>
\r\n
</Modal.Header>
\r\n
<Modal.Body className=
\"
show-grid
\"
>
\r\n
<Container style={{ fontSize: '40px' }}>
\r\n
{reviews.map((review, index) => {\r
\n
return (
\r\n
<Row className=
\"
mt-4
\"
>
\r\n
<a href=
{
review.link}>{review.title
}
</a>
\r\n
<div>
{
review.summary
}
</div>
\r\n
<div>
{
review.content
}
</div>
\r\n
</Row>
\r\n
)
\r\n
})}
\r\n
</Container>
\r\n\r\n
</Modal.Body>
\r\n
<Modal.Footer>
\r\n
<Button block onClick=
{
props.onHide
}
>Close</Button>
\r\n
</Modal.Footer>
\r\n
</Modal>
\r\n
);
\r\n
}
\r\n\r\n
export default Place;
\r\n
"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
Login.js"
,[],
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
utils
\\
catchErrors.js"
,[],
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
Signup.js"
,[],
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
utils
\\
auth.js"
,[],
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
Paginations.js"
,[],
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Search.js"
,[
"63"
,
"64"
,
"65"
,
"66"
,
"67"
,
"68"
,
"69"
,
"70"
,
"71"
,
"72"
],
"import React, { useState, useEffect } from 'react';
\r\n
import { Link, Redirect } from 'react-router-dom';
\r\n
import ohuh from './ohuh-sm.PNG';
\r\n
import Place from './Components/Place';
\r\n
import { Container, Form, Row, Col, Card, Image, InputGroup, FormControl, Button, Modal } from 'react-bootstrap';
\r\n
import Paginations from './Components/Paginations.js'
\r\n
import catchErrors from './utils/catchErrors.js'
\r\n
import * as Icon from 'react-bootstrap-icons';
\r\n
import axios from
\"
axios
\"
;
\r\n\r\n
const INIT_PAGE = {\r
\n
title: '',
\r\n
url: '',
\r\n
}
\r\n\r\n
function Search(props) {\r
\n
const endPage = 10;
\r\n
const [state, setState] = useState(false);
\r\n
const [index, setIndex] = useState(1);
\r\n
const [showSet, setShowSet] = useState([false, false, false, false]);
\r\n
const [search, setSearch] = useState(props.location.state.id);
\r\n
const [mobile, setMobile] = useState();
\r\n
const [show, setShow] = useState(false);
\r\n
const [page, setPage] = useState(INIT_PAGE)
\r\n
const [success, setSuccess] = useState(false)
\r\n
const [error, setError] = useState('')
\r\n\r\n
const handleClose = () => setShow(false);
\r\n
const handleShow = () => setShow(true);
\r\n\r\n
useEffect(() => {\r
\n
if (window.innerWidth < 960) {\r
\n
setMobile(true)
\r\n
} else {\r
\n
setMobile(false)
\r\n
}
\r\n
}, []);
\r\n\r\n
const places = [{\r
\n
name:
\"
한라산(hallasan)
\"
,
\r\n
address:
\"
제주 서귀포시 토평동 산15-1
\"
,
\r\n
img:
\"
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOUAAADcCAMAAAC4YpZBAAAAkFBMVEX4ugAAAAD8vQD/vwD/wQAAAAP9vQD2uQCwhAO9jgVAMAbmrANTPwYQDAONaQDQmwN2WQG3iwMyJwZAMACofgMKCAZOOwTHlgGFYwfwtAKYcgYpHwHXoQXepgTorgTxtQJjSgCgeAUgGANwVAUZEwJeRgOKaAR8XQRbRAcnHgQ3KgZPOwGrgQJINQZrUQYeFwOi9fVkAAAIi0lEQVR4nO2b2XaCSBCG6WpaRFTcIoKAIuJu8v5vN72BoOiYnEzEM/XdJEBD+Omllq4YBoIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgvwpIXv0W3wUectW0RWNvmJxs13ozpaf2A2zr0hCs8HRmRLP6tJ1bnbSGRnwN8ohuXLQzw3RVvTjt+7T6LGfTvyVpgExg9foUWa4S/P7X7eWOXX3WpO4Z0yaofNiXuUqIP2uvs365N+myrs2x9RJhFZ5T6Q/uNGDl8WjO31ol9AtV42yZLnfjXnGiXZJZ+4wmqTx0ajgMfNkmyidv2o5NSk1w7DQ/dSgWKHBrVZ4bNC/t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rKeeuyohZGQr/s8SvJUoc65Vaeg1NiPZQu4edcmO0j5ZxfJoU/6vv1dyV6Vh9Qn5tEM3WZNRBA/7Uiw4Wy8MvUDuzDsHMpp4obthpN0M50essVWVc60SfG4F2WjFo2uRDaCsULlSKlNRN0E7cvXhVvfj0PnifoXw3V3u3H0dVkX92suxguO2Mqro5zH/RzxqL4+jTjaTmRLYHU/yp3tcqs8SHCf8cHCUxsLOxqPROBtKXwesGT8cL5thLAX0uhKNXsrMwLRCJ7+en4fqCX0aIA7DuIgwKXXCBpXn/xvfqVy7Crh/+U0QBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEGQ/yH/ALoViVlZW8doAAAAAElFTkSuQmCC
\"
,
\r\n
// 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
\"
,
\r\n
// }, {\r
\n
// name:
\"
성산일출봉(sungsan)
\"
,
\r\n
// address:
\"
제주 서귀포시 성산읍 성산리 1
\"
,
\r\n
// 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
\"
,
\r\n
// }, {\r
\n
// name:
\"
해녀의 집(haenyeo)
\"
,
\r\n
// address:
\"
제주 서귀포시 성산읍 한도로 141-13지번오조리 3 오조해녀의집
\"
,
\r\n
// img:
\"
https://mblogthumb-phinf.pstatic.net/MjAxNjExMTdfMTc0/MDAxNDc5MzU3ODU0ODQy.KZYXCjzsXT3rCsE4HXBfxyCg2buvluBvN_7NxVp7BSwg.loJc89d8JjGXdNCn-4yMd7aMWPjfrZn21TI9Hyzemkog.JPEG.icocam11/20161010_100205.jpg?type=w800
\"
,
\r\n
// }, {\r
\n
// name:
\"
오설록 티 뮤지엄(osulloc)
\"
,
\r\n
// address:
\"
제주 서귀포시 안덕면 신화역사로 15 오설록지번서광리 1235-1 오설록
\"
,
\r\n
// img:
\"
https://cdnweb01.wikitree.co.kr/webdata/editor/202007/01/img_20200701143323_2ced7627.webp
\"
,
\r\n
// }, {\r
\n
// name:
\"
오설록 티 뮤지엄(osulloc)
\"
,
\r\n
// address:
\"
제주 서귀포시 안덕면 신화역사로 15 오설록지번서광리 1235-1 오설록
\"
,
\r\n
// 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
\"
,
\r\n
}]
\r\n\r\n
if (state !== false) {\r
\n
return <Redirect to={{\r
\n
pathname: `/search/${search}`,
\r\n
state: { id: search },
\r\n
}} />;
\r\n
}
\r\n\r\n
const handlePage = (num) => {\r
\n
setIndex(num);
\r\n
}
\r\n\r\n
// async function bookmarkSave() {\r
\n
// await axios.put('/api/users', {userId:userId, bookmarkId:bookmarkId})
\r\n
// }
\r\n\r\n
const handleChange = (e) => {\r
\n
setSearch(e.target.value);
\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
function paginate(items, pageNumber, itemNumber) {\r
\n
const page = []; //페이지를 빈배열로 설정
\r\n
const startIndex = (pageNumber - 1) * itemNumber // 처음인덱스 값이 페이지넘버 -1 * 아이템 넘버로
\r\n
for (var i = 0; i < itemNumber; i++) {
\r\n
page.push(items[(startIndex + i)])
\r\n
}
\r\n
return page
\r\n
}
\r\n\r\n
const pagePlace = paginate(places, index, 1)
\r\n\r\n
return (
\r\n
<Container >
\r\n
<Link to=
\"
/
\"
className=
\"
d-flex justify-content-center
\"
><Image src=
{
ohuh
}
/></Link>
\r\n
<Row className=
\"
mb-2
\"
className=
\"
d-flex justify-content-center
\"
>
\r\n
<Form style={{ width:
\"
90vw
\"
}} onSubmit=
{
handleSubmit
}
>
\r\n
<InputGroup size=
\"
lg
\"
>
\r\n
<FormControl
\r\n
placeholder=
\"
검색어를 입력하세요.
\"\r\n
value=
{
search
}
\r\n
aria-label=
\"
Large
\"\r\n
aria-describedby=
\"
inputGroup-sizing-sm
\"\r\n
onChange=
{
handleChange
}
\r\n
/>
\r\n
<InputGroup.Append>
\r\n
<Button type=
\"
submit
\"
variant=
\"
outline-secondary
\"
style={{ maxHeight:
\"
8vh
\"
, maxWidth:
\"
14vh
\"
}} >검색</Button>
\r\n
</InputGroup.Append>
\r\n
</InputGroup>
\r\n
</Form>
\r\n
</Row>
\r\n
<Row className=
\"
d-flex flex-wrap
\"
>
\r\n
{pagePlace.map((place, index) => {\r
\n
return (
\r\n
<Col key=
{
index
}
md=
{
6
}
>
\r\n
<Card align=
\"
center
\"
border=
\"
info
\"
style={{ margin:
\"
3%
\"
}}>
\r\n
<Button onSubmit=
{
handleSubmit
}
variant=
\"
outline-info
\"
style={{ marginLeft:
\"
55vh
\"
}} type='submit'><Icon.BookmarkStar size=
{
30
}
/></Button>
\r\n
<Card.Title style={{ margin:
\"
3%
\"
, fontSize: '200%', fontWeight: 'bold' }}>
{
place.name
}
\r\n
</Card.Title>
\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: '25px', width: '100%', height:
\"
80px
\"
}} >
\r\n
{
place.address
}
</Card.Text>
\r\n
<Button variant=
\"
primary
\"
onClick={() => {\r
\n
const showArr = [false, false, false, false]
\r\n
showArr[index] = true
\r\n
setShowSet(showArr)
\r\n
}}>
{
place.name
}
자세히 살펴보기</Button>
\r\n
<Place search=
{
place
}
index=
{
index
}
show=
{
showSet[index]
}
onHide={() => setShowSet([false, false, false, false])} />
\r\n
</Card.Body>
\r\n
</Card>
\r\n
</Col>
\r\n
)
\r\n
})}
\r\n
</Row>
\r\n
{ console.log(showSet)}
\r\n
{/* show가 전부 true로 바뀌어서 전부 다 보이게 되는 것이다. */}
\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\r\n
export default Search
\r\n\r\n
// async function saveId(bookmarkId) {\r
\n
// await axios.put('/api/users', {userId:userId, bookmarkId:bookmarkId})
\r\n
// }
\r\n\r\n
// const bookmarksave = async (req, res) => {\r
\n
// const {userId, bookmarkId} = req.body
\r\n
// let bookmark = await Bookmark.findOne(
{
bookmarkId:bookmarkId
}
).select('user')
\r\n
// }
\r\n
"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
App.js"
,[
"73"
,
"74"
,
"75"
,
"76"
],
"import React, { useEffect, useState } from 'react';
\r\n
import { Link, Redirect } from 'react-router-dom';
\r\n
import ohuh from './ohuh.PNG'
\r\n
import { Container, Row, Form, Image, InputGroup, Button, Col, FormControl, Navbar, Nav } from 'react-bootstrap';
\r\n
import { handleLogout, isAuthenticated } from './utils/auth.js'
\r\n\r\n
function App() {\r
\n
const [state, setState] = useState(false);
\r\n
const [search, setSearch] = useState(
\"\"
);
\r\n
const user = isAuthenticated()
\r\n\r\n
if (state !== false) {\r
\n
return <Redirect to={{\r
\n
pathname: `/search/${search}`,
\r\n
state: { id: search },
\r\n
}} />;
\r\n
}
\r\n\r\n
const handleChange = (e) => {\r
\n
setSearch(e.target.value);
\r\n
}
\r\n\r\n
const handleSubmit = () => {\r
\n
setState(true);
\r\n
}
\r\n\r\n
return (
\r\n
<Container className=
\"
vh-100 d-flex justify-content-md-center align-items-center
\"
>
\r\n
<Col md=
{
6
}
style={{ marginTop: 140 }}>
\r\n
<Nav className=
\"
justify-content-end
\"
bg=
\"
#fff
\"
variant=
\"
light
\"
>
\r\n
{user ? <Nav.Link onClick={() => handleLogout()}>로그아웃</Nav.Link>
\r\n
: (
\r\n
<>
\r\n
<Nav.Link href=
\"
/signup
\"
>회원가입</Nav.Link>
\r\n
<Nav.Link href=
\"
/login
\"
>로그인</Nav.Link>
\r\n
</>
\r\n
)}
\r\n
<Nav.Link href='/bookmark'>북마크</Nav.Link>
\r\n
</Nav>
\r\n
<Row style={{ marginBottom: 20 }}>
\r\n
<Image src=
{
ohuh
}
/>
\r\n
</Row>
\r\n
<Row style={{ marginBottom: 500 }}>
\r\n
<Form className=
\"
vw-100
\"
onSubmit=
{
handleSubmit
}
>
\r\n
<InputGroup style={{ width: 560 }}>
\r\n
<Form.Control
\r\n
size=
\"
lg
\"\r\n
placeholder=
\"
검색어를 입력하세요.
\"\r\n
aria-label=
\"
Large
\"\r\n
aria-describedby=
\"
inputGroup-sizing-sm
\"\r\n
onChange=
{
handleChange
}
\r\n
/>
\r\n
<InputGroup.Append>
\r\n
<Button type='submit' variant=
\"
outline-secondary
\"
>검색</Button>
\r\n
</InputGroup.Append>
\r\n
</InputGroup>
\r\n
</Form>
\r\n
</Row>
\r\n
</Col>
\r\n
</Container>
\r\n
);
\r\n
}
\r\n\r\n
export default App;
\r\n
"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
PrivateRoute.js"
,[],
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Bookmark.js"
,[
"77"
,
"78"
,
"79"
,
"80"
,
"81"
,
"82"
,
"83"
,
"84"
,
"85"
,
"86"
,
"87"
,
"88"
,
"89"
,
"90"
],
"import React, { useState, useEffect } from 'react'
\r\n
import { Alert, Col, Card, Container, Form, Row, Button, Nav, Navbar, ListGroup, Image, Table } from
\"
react-bootstrap
\"\r\n
import axios from
\"
axios
\"\r\n
import catchErrors from './utils/catchErrors.js'
\r\n
import { Redirect } from 'react-router-dom'
\r\n\r\n
const INIT_PAGE = {\r
\n
title: '',
\r\n
url: '',
\r\n
}
\r\n\r\n
function Bookmark() {\r
\n
const [page, setPage] = useState(INIT_PAGE)
\r\n
const [success, setSuccess] = useState(false)
\r\n
const [error, setError] = useState('')
\r\n\r\n\r\n
function handleChange(event) {\r
\n
const {title, value} = event.target
\r\n
setPage({...page, [title]: value})
\r\n
}
\r\n\r\n
async function handleSubmit(event) {\r
\n
event.preventDefault()
\r\n
try {\r
\n
setError('')
\r\n
const response = await axios.post('/api/users/bookmark ', page)
\r\n
console.log(response.data)
\r\n
console.log(page)
\r\n
// setUser(INIT_USER)
\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
const add_Page = [{\r
\n
title:'즐겨찾기1',
\r\n
url:'http://localhost:3000',
\r\n
}, {\r
\n
title:'즐겨찾기2',
\r\n
url:'https://www.naver.com/',
\r\n
}, {\r
\n
title:'즐겨찾기3',
\r\n
url:'https://www.youtube.com/watch?v=wo46N-LQK7o'
\r\n
}]
\r\n\r\n
return (
\r\n
<Container>
\r\n
<Navbar bg=
\"
primary
\"
variant=
\"
dark
\"
>
\r\n
<Navbar.Brand href=
\"
/
\"
>북마크</Navbar.Brand>
\r\n
<Nav className=
\"
mr-auto
\"
>
\r\n
<Nav.Link href=
\"
/
\"
>Home</Nav.Link>
\r\n
</Nav>
\r\n
{/* <Form inline>
\r\n
<FormControl type=
\"
text
\"
placeholder=
\"
Search
\"
className=
\"
mr-sm-2
\"
/>
\r\n
<Button variant=
\"
outline-light
\"
>Search</Button>
\r\n
</Form> */}
\r\n
</Navbar>
\r\n
<Form>
\r\n
<ListGroup>
\r\n
<ListGroup.Item action href=
\"\"
>북마크1</ListGroup.Item>
\r\n
<ListGroup.Item>북마크2</ListGroup.Item>
\r\n
</ListGroup>
\r\n
</Form>
\r\n
</Container>
\r\n
)
\r\n
}
\r\n\r\n
export default Bookmark"
,{
"ruleId"
:
"91"
,
"replacedBy"
:
"92"
},{
"ruleId"
:
"93"
,
"replacedBy"
:
"94"
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"96"
,
"line"
:
3
,
"column"
:
33
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
3
,
"endColumn"
:
36
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"99"
,
"line"
:
3
,
"column"
:
46
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
3
,
"endColumn"
:
51
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"100"
,
"line"
:
3
,
"column"
:
53
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
3
,
"endColumn"
:
57
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"101"
,
"line"
:
3
,
"column"
:
59
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
3
,
"endColumn"
:
68
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"102"
,
"line"
:
3
,
"column"
:
70
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
3
,
"endColumn"
:
78
},{
"ruleId"
:
"103"
,
"severity"
:
1
,
"message"
:
"104"
,
"line"
:
20
,
"column"
:
6
,
"nodeType"
:
"105"
,
"endLine"
:
20
,
"endColumn"
:
8
,
"suggestions"
:
"106"
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"107"
,
"line"
:
5
,
"column"
:
83
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
5
,
"endColumn"
:
88
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"108"
,
"line"
:
22
,
"column"
:
12
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
22
,
"endColumn"
:
18
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"109"
,
"line"
:
23
,
"column"
:
12
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
23
,
"endColumn"
:
16
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"110"
,
"line"
:
24
,
"column"
:
18
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
24
,
"endColumn"
:
25
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"111"
,
"line"
:
25
,
"column"
:
12
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
25
,
"endColumn"
:
19
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"112"
,
"line"
:
26
,
"column"
:
12
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
26
,
"endColumn"
:
17
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"113"
,
"line"
:
28
,
"column"
:
11
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
28
,
"endColumn"
:
22
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"114"
,
"line"
:
29
,
"column"
:
11
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
29
,
"endColumn"
:
21
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"115"
,
"line"
:
84
,
"column"
:
19
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
84
,
"endColumn"
:
27
},{
"ruleId"
:
"116"
,
"severity"
:
1
,
"message"
:
"117"
,
"line"
:
106
,
"column"
:
35
,
"nodeType"
:
"118"
,
"endLine"
:
106
,
"endColumn"
:
76
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"119"
,
"line"
:
1
,
"column"
:
17
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
1
,
"endColumn"
:
26
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"120"
,
"line"
:
2
,
"column"
:
10
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
2
,
"endColumn"
:
14
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"121"
,
"line"
:
4
,
"column"
:
64
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
4
,
"endColumn"
:
75
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"122"
,
"line"
:
4
,
"column"
:
77
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
4
,
"endColumn"
:
83
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"119"
,
"line"
:
1
,
"column"
:
27
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
1
,
"endColumn"
:
36
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"123"
,
"line"
:
2
,
"column"
:
10
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
2
,
"endColumn"
:
15
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"96"
,
"line"
:
2
,
"column"
:
17
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
2
,
"endColumn"
:
20
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"100"
,
"line"
:
2
,
"column"
:
22
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
2
,
"endColumn"
:
26
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"124"
,
"line"
:
2
,
"column"
:
45
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
2
,
"endColumn"
:
48
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"125"
,
"line"
:
2
,
"column"
:
50
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
2
,
"endColumn"
:
56
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"126"
,
"line"
:
2
,
"column"
:
82
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
2
,
"endColumn"
:
87
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"127"
,
"line"
:
2
,
"column"
:
89
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
2
,
"endColumn"
:
94
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"128"
,
"line"
:
5
,
"column"
:
10
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
5
,
"endColumn"
:
18
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"111"
,
"line"
:
14
,
"column"
:
12
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
14
,
"endColumn"
:
19
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"112"
,
"line"
:
15
,
"column"
:
12
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
15
,
"endColumn"
:
17
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"129"
,
"line"
:
18
,
"column"
:
14
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
18
,
"endColumn"
:
26
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"130"
,
"line"
:
23
,
"column"
:
20
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
23
,
"endColumn"
:
32
},{
"ruleId"
:
"95"
,
"severity"
:
1
,
"message"
:
"131"
,
"line"
:
38
,
"column"
:
11
,
"nodeType"
:
"97"
,
"messageId"
:
"98"
,
"endLine"
:
38
,
"endColumn"
:
19
},
"no-native-reassign"
,[
"132"
],
"no-negated-in-lhs"
,[
"133"
],
"no-unused-vars"
,
"'Col' is defined but never used."
,
"Identifier"
,
"unusedVar"
,
"'Badge' is defined but never used."
,
"'Card' is defined but never used."
,
"'Accordion' is defined but never used."
,
"'Carousel' is defined but never used."
,
"react-hooks/exhaustive-deps"
,
"React Hook useEffect has a missing dependency: 'getReview'. Either include it or remove the dependency array."
,
"ArrayExpression"
,[
"134"
],
"'Modal' is defined but never used."
,
"'mobile' is assigned a value but never used."
,
"'show' is assigned a value but never used."
,
"'setPage' is assigned a value but never used."
,
"'success' is assigned a value but never used."
,
"'error' is assigned a value but never used."
,
"'handleClose' is assigned a value but never used."
,
"'handleShow' is assigned a value but never used."
,
"'response' is assigned a value but never used."
,
"react/jsx-no-duplicate-props"
,
"No duplicate props allowed"
,
"JSXAttribute"
,
"'useEffect' is defined but never used."
,
"'Link' is defined but never used."
,
"'FormControl' is defined but never used."
,
"'Navbar' is defined but never used."
,
"'Alert' is defined but never used."
,
"'Row' is defined but never used."
,
"'Button' is defined but never used."
,
"'Image' is defined but never used."
,
"'Table' is defined but never used."
,
"'Redirect' is defined but never used."
,
"'handleChange' is defined but never used."
,
"'handleSubmit' is defined but never used."
,
"'add_Page' is assigned a value but never used."
,
"no-global-assign"
,
"no-unsafe-negation"
,{
"desc"
:
"135"
,
"fix"
:
"136"
},
"Update the dependencies array to be: [getReview]"
,{
"range"
:
"137"
,
"text"
:
"138"
},[
581
,
583
],
"[getReview]"
]
\ No newline at end of file
[{
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
index.js"
:
"1"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
reportWebVitals.js"
:
"2"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
Place.js"
:
"3"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
Login.js"
:
"4"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
utils
\\
catchErrors.js"
:
"5"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
Signup.js"
:
"6"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
utils
\\
auth.js"
:
"7"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
Paginations.js"
:
"8"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Search.js"
:
"9"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
App.js"
:
"10"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
PrivateRoute.js"
:
"11"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Bookmark.js"
:
"12"
},{
"size"
:
1368
,
"mtime"
:
1611270972548
,
"results"
:
"13"
,
"hashOfConfig"
:
"14"
},{
"size"
:
362
,
"mtime"
:
499162500000
,
"results"
:
"15"
,
"hashOfConfig"
:
"14"
},{
"size"
:
1586
,
"mtime"
:
1611491429445
,
"results"
:
"16"
,
"hashOfConfig"
:
"14"
},{
"size"
:
3075
,
"mtime"
:
1611489617094
,
"results"
:
"17"
,
"hashOfConfig"
:
"14"
},{
"size"
:
405
,
"mtime"
:
1609915408569
,
"results"
:
"18"
,
"hashOfConfig"
:
"14"
},{
"size"
:
2995
,
"mtime"
:
1611489922054
,
"results"
:
"19"
,
"hashOfConfig"
:
"14"
},{
"size"
:
726
,
"mtime"
:
1611495738863
,
"results"
:
"20"
,
"hashOfConfig"
:
"14"
},{
"size"
:
2199
,
"mtime"
:
1610503781980
,
"results"
:
"21"
,
"hashOfConfig"
:
"14"
},{
"size"
:
11142
,
"mtime"
:
1611489922078
,
"results"
:
"22"
,
"hashOfConfig"
:
"14"
},{
"size"
:
2216
,
"mtime"
:
1611495738863
,
"results"
:
"23"
,
"hashOfConfig"
:
"14"
},{
"size"
:
486
,
"mtime"
:
1611489922054
,
"results"
:
"24"
,
"hashOfConfig"
:
"14"
},{
"size"
:
2226
,
"mtime"
:
1611489922053
,
"results"
:
"25"
,
"hashOfConfig"
:
"14"
},{
"filePath"
:
"26"
,
"messages"
:
"27"
,
"errorCount"
:
0
,
"warningCount"
:
0
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"usedDeprecatedRules"
:
"28"
},
"1t9w6go"
,{
"filePath"
:
"29"
,
"messages"
:
"30"
,
"errorCount"
:
0
,
"warningCount"
:
0
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"usedDeprecatedRules"
:
"28"
},{
"filePath"
:
"31"
,
"messages"
:
"32"
,
"errorCount"
:
0
,
"warningCount"
:
6
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"source"
:
"33"
,
"usedDeprecatedRules"
:
"28"
},{
"filePath"
:
"34"
,
"messages"
:
"35"
,
"errorCount"
:
0
,
"warningCount"
:
0
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"usedDeprecatedRules"
:
"28"
},{
"filePath"
:
"36"
,
"messages"
:
"37"
,
"errorCount"
:
0
,
"warningCount"
:
0
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"usedDeprecatedRules"
:
"28"
},{
"filePath"
:
"38"
,
"messages"
:
"39"
,
"errorCount"
:
0
,
"warningCount"
:
0
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"usedDeprecatedRules"
:
"28"
},{
"filePath"
:
"40"
,
"messages"
:
"41"
,
"errorCount"
:
0
,
"warningCount"
:
0
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
},{
"filePath"
:
"42"
,
"messages"
:
"43"
,
"errorCount"
:
0
,
"warningCount"
:
0
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"usedDeprecatedRules"
:
"28"
},{
"filePath"
:
"44"
,
"messages"
:
"45"
,
"errorCount"
:
0
,
"warningCount"
:
10
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"source"
:
"46"
,
"usedDeprecatedRules"
:
"28"
},{
"filePath"
:
"47"
,
"messages"
:
"48"
,
"errorCount"
:
0
,
"warningCount"
:
4
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"source"
:
null
},{
"filePath"
:
"49"
,
"messages"
:
"50"
,
"errorCount"
:
0
,
"warningCount"
:
0
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"usedDeprecatedRules"
:
"28"
},{
"filePath"
:
"51"
,
"messages"
:
"52"
,
"errorCount"
:
0
,
"warningCount"
:
14
,
"fixableErrorCount"
:
0
,
"fixableWarningCount"
:
0
,
"source"
:
"53"
,
"usedDeprecatedRules"
:
"28"
},
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
index.js"
,[],[
"54"
,
"55"
],
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
reportWebVitals.js"
,[],
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
Place.js"
,[
"56"
,
"57"
,
"58"
,
"59"
,
"60"
,
"61"
],
"import axios from 'axios';
\r\n
import React, { useEffect, useState } from 'react';
\r\n
import { Modal, Container, Row, Button, } from 'react-bootstrap';
\r\n\r\n
function Place(props) {\r
\n
<<<<<<< HEAD
\r\n
const [reviews, setReviews] = useState([])
\r\n
const getReview = () => { //review를 서버에 연결해서
\r\n
axios.get(`/api/review/${props.search.name}`)
\r\n
=======
\r\n
const [reviews, setReviews] = useState([{ title:
\"\"
, link:
\"\"
, summery:
\"\"
, content:
\"\"
}])
\r\n
const getReview = () => {\r
\n
axios.get(`/api/review/${props.search.name}`)
\r\n
>>>>>>> origin/BAE
\r\n
.then(res => {\r
\n
console.log(
\"
place res.data
\"
, res.data)
\r\n
setReviews(res.data)
\r\n
})
\r\n
.catch(err => {\r
\n
console.log(err)
\r\n
})
\r\n
}
\r\n\r\n
useEffect(() => {\r
\n
getReview();
\r\n
}, [])
\r\n\r\n
return (
\r\n
<Modal
{
...props
}
\r\n
size=
\"
xl
\"\r\n
keyboard=
\"
true
\"\r\n
variant=
\"
backdrop.in
\"\r\n
aria-labelledby=
\"
example-modal-sizes-title-lg
\"
>
\r\n
<Modal.Header closeButton>
\r\n
<Modal.Title id=
\"
contained-modal-title-vcenter
\"
style={{ fontSize: '40px' }}>
\r\n
{props.index + 1}.
{
props.search.name
}
\r\n
</Modal.Title>
\r\n
</Modal.Header>
\r\n
<Modal.Body className=
\"
show-grid
\"
>
\r\n
<Container style={{ fontSize: '40px' }}>
\r\n
{reviews.map((review, index) => {\r
\n
return (
\r\n
<Row className=
\"
mt-4
\"
>
\r\n
<a href=
{
review.link}>{review.title
}
</a>
\r\n
<div>
{
review.summary
}
</div>
\r\n
<div>
{
review.content
}
</div>
\r\n
</Row>
\r\n
)
\r\n
})}
\r\n
</Container>
\r\n\r\n
</Modal.Body>
\r\n
<Modal.Footer>
\r\n
<Button block onClick=
{
props.onHide
}
>Close</Button>
\r\n
</Modal.Footer>
\r\n
</Modal>
\r\n
);
\r\n
}
\r\n\r\n
export default Place;
\r\n
"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
Login.js"
,[],
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
utils
\\
catchErrors.js"
,[],
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
Signup.js"
,[],
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
utils
\\
auth.js"
,[],
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
Paginations.js"
,[],
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Search.js"
,[
"62"
,
"63"
,
"64"
,
"65"
,
"66"
,
"67"
,
"68"
,
"69"
,
"70"
,
"71"
],
"import React, { useState, useEffect } from 'react';
\r\n
import { Link, Redirect } from 'react-router-dom';
\r\n
import ohuh from './ohuh-sm.PNG';
\r\n
import Place from './Components/Place';
\r\n
import { Container, Form, Row, Col, Card, Image, InputGroup, FormControl, Button, Modal } from 'react-bootstrap';
\r\n
import Paginations from './Components/Paginations.js'
\r\n
import catchErrors from './utils/catchErrors.js'
\r\n
import * as Icon from 'react-bootstrap-icons';
\r\n
import axios from
\"
axios
\"
;
\r\n\r\n
const INIT_PAGE = {\r
\n
title: '',
\r\n
url: '',
\r\n
}
\r\n\r\n
function Search(props) {\r
\n
const endPage = 10;
\r\n
const [state, setState] = useState(false);
\r\n
const [index, setIndex] = useState(1);
\r\n
const [showSet, setShowSet] = useState([false, false, false, false]);
\r\n
const [search, setSearch] = useState(props.location.state.id);
\r\n
const [mobile, setMobile] = useState();
\r\n
const [show, setShow] = useState(false);
\r\n
const [page, setPage] = useState(INIT_PAGE)
\r\n
const [success, setSuccess] = useState(false)
\r\n
const [error, setError] = useState('')
\r\n\r\n
const handleClose = () => setShow(false);
\r\n
const handleShow = () => setShow(true);
\r\n\r\n
useEffect(() => {\r
\n
if (window.innerWidth < 960) {\r
\n
setMobile(true)
\r\n
} else {\r
\n
setMobile(false)
\r\n
}
\r\n
}, []);
\r\n\r\n
const places = [{\r
\n
name:
\"
한라산(hallasan)
\"
,
\r\n
address:
\"
제주 서귀포시 토평동 산15-1
\"
,
\r\n
img:
\"
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOUAAADcCAMAAAC4YpZBAAA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Jeju-do_%286387785543%29.jpg/269px-KOCIS_Halla_Mountain_in_Jeju-do_%286387785543%29.jpg?size=200x200
\"
,
\r\n
// }, {\r
\n
// name:
\"
성산일출봉(sungsan)
\"
,
\r\n
// address:
\"
제주 서귀포시 성산읍 성산리 1
\"
,
\r\n
// 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
\"
,
\r\n
// }, {\r
\n
// name:
\"
해녀의 집(haenyeo)
\"
,
\r\n
// address:
\"
제주 서귀포시 성산읍 한도로 141-13지번오조리 3 오조해녀의집
\"
,
\r\n
// img:
\"
https://mblogthumb-phinf.pstatic.net/MjAxNjExMTdfMTc0/MDAxNDc5MzU3ODU0ODQy.KZYXCjzsXT3rCsE4HXBfxyCg2buvluBvN_7NxVp7BSwg.loJc89d8JjGXdNCn-4yMd7aMWPjfrZn21TI9Hyzemkog.JPEG.icocam11/20161010_100205.jpg?type=w800
\"
,
\r\n
// }, {\r
\n
// name:
\"
오설록 티 뮤지엄(osulloc)
\"
,
\r\n
// address:
\"
제주 서귀포시 안덕면 신화역사로 15 오설록지번서광리 1235-1 오설록
\"
,
\r\n
// img:
\"
https://cdnweb01.wikitree.co.kr/webdata/editor/202007/01/img_20200701143323_2ced7627.webp
\"
,
\r\n
// }, {\r
\n
// name:
\"
오설록 티 뮤지엄(osulloc)
\"
,
\r\n
// address:
\"
제주 서귀포시 안덕면 신화역사로 15 오설록지번서광리 1235-1 오설록
\"
,
\r\n
// 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
\"
,
\r\n
}]
\r\n\r\n
if (state !== false) {\r
\n
return <Redirect to={{\r
\n
pathname: `/search/${search}`,
\r\n
state: { id: search },
\r\n
}} />;
\r\n
}
\r\n\r\n
const handlePage = (num) => {\r
\n
setIndex(num);
\r\n
}
\r\n\r\n
// async function bookmarkSave() {\r
\n
// await axios.put('/api/users', {userId:userId, bookmarkId:bookmarkId})
\r\n
// }
\r\n\r\n
const handleChange = (e) => {\r
\n
setSearch(e.target.value);
\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
function paginate(items, pageNumber, itemNumber) {\r
\n
const page = []; //페이지를 빈배열로 설정
\r\n
const startIndex = (pageNumber - 1) * itemNumber // 처음인덱스 값이 페이지넘버 -1 * 아이템 넘버로
\r\n
for (var i = 0; i < itemNumber; i++) {
\r\n
page.push(items[(startIndex + i)])
\r\n
}
\r\n
return page
\r\n
}
\r\n\r\n
const pagePlace = paginate(places, index, 1)
\r\n\r\n
return (
\r\n
<Container >
\r\n
<Link to=
\"
/
\"
className=
\"
d-flex justify-content-center
\"
><Image src=
{
ohuh
}
/></Link>
\r\n
<Row className=
\"
mb-2
\"
className=
\"
d-flex justify-content-center
\"
>
\r\n
<Form style={{ width:
\"
90vw
\"
}} onSubmit=
{
handleSubmit
}
>
\r\n
<InputGroup size=
\"
lg
\"
>
\r\n
<FormControl
\r\n
placeholder=
\"
검색어를 입력하세요.
\"\r\n
value=
{
search
}
\r\n
aria-label=
\"
Large
\"\r\n
aria-describedby=
\"
inputGroup-sizing-sm
\"\r\n
onChange=
{
handleChange
}
\r\n
/>
\r\n
<InputGroup.Append>
\r\n
<Button type=
\"
submit
\"
variant=
\"
outline-secondary
\"
style={{ maxHeight:
\"
8vh
\"
, maxWidth:
\"
14vh
\"
}} >검색</Button>
\r\n
</InputGroup.Append>
\r\n
</InputGroup>
\r\n
</Form>
\r\n
</Row>
\r\n
<Row className=
\"
d-flex flex-wrap
\"
>
\r\n
{pagePlace.map((place, index) => {\r
\n
return (
\r\n
<Col key=
{
index
}
md=
{
6
}
>
\r\n
<Card align=
\"
center
\"
border=
\"
info
\"
style={{ margin:
\"
3%
\"
}}>
\r\n
<Button onSubmit=
{
handleSubmit
}
variant=
\"
outline-info
\"
style={{ marginLeft:
\"
55vh
\"
}} type='submit'><Icon.BookmarkStar size=
{
30
}
/></Button>
\r\n
<Card.Title style={{ margin:
\"
3%
\"
, fontSize: '200%', fontWeight: 'bold' }}>
{
place.name
}
\r\n
</Card.Title>
\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: '25px', width: '100%', height:
\"
80px
\"
}} >
\r\n
{
place.address
}
</Card.Text>
\r\n
<Button variant=
\"
primary
\"
onClick={() => {\r
\n
const showArr = [false, false, false, false]
\r\n
showArr[index] = true
\r\n
setShowSet(showArr)
\r\n
}}>
{
place.name
}
자세히 살펴보기</Button>
\r\n
<Place search=
{
place
}
index=
{
index
}
show=
{
showSet[index]
}
onHide={() => setShowSet([false, false, false, false])} />
\r\n
</Card.Body>
\r\n
</Card>
\r\n
</Col>
\r\n
)
\r\n
})}
\r\n
</Row>
\r\n
{ console.log(showSet)}
\r\n
{/* show가 전부 true로 바뀌어서 전부 다 보이게 되는 것이다. */}
\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\r\n
export default Search
\r\n\r\n
// async function saveId(bookmarkId) {\r
\n
// await axios.put('/api/users', {userId:userId, bookmarkId:bookmarkId})
\r\n
// }
\r\n\r\n
// const bookmarksave = async (req, res) => {\r
\n
// const {userId, bookmarkId} = req.body
\r\n
// let bookmark = await Bookmark.findOne(
{
bookmarkId:bookmarkId
}
).select('user')
\r\n
// }
\r\n
"
,
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
App.js"
,[
"72"
,
"73"
,
"74"
,
"75"
],
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Components
\\
PrivateRoute.js"
,[],
"C:
\\
Users
\\
hello
\\
Desktop
\\
project
\\
search-page
\\
client
\\
src
\\
Bookmark.js"
,[
"76"
,
"77"
,
"78"
,
"79"
,
"80"
,
"81"
,
"82"
,
"83"
,
"84"
,
"85"
,
"86"
,
"87"
,
"88"
,
"89"
],
"import React, { useState, useEffect } from 'react'
\r\n
import { Alert, Col, Card, Container, Form, Row, Button, Nav, Navbar, ListGroup, Image, Table } from
\"
react-bootstrap
\"\r\n
import axios from
\"
axios
\"\r\n
import catchErrors from './utils/catchErrors.js'
\r\n
import { Redirect } from 'react-router-dom'
\r\n\r\n
const INIT_PAGE = {\r
\n
title: '',
\r\n
url: '',
\r\n
}
\r\n\r\n
function Bookmark() {\r
\n
const [page, setPage] = useState(INIT_PAGE)
\r\n
const [success, setSuccess] = useState(false)
\r\n
const [error, setError] = useState('')
\r\n\r\n\r\n
function handleChange(event) {\r
\n
const {title, value} = event.target
\r\n
setPage({...page, [title]: value})
\r\n
}
\r\n\r\n
async function handleSubmit(event) {\r
\n
event.preventDefault()
\r\n
try {\r
\n
setError('')
\r\n
const response = await axios.post('/api/users/bookmark ', page)
\r\n
console.log(response.data)
\r\n
console.log(page)
\r\n
// setUser(INIT_USER)
\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
const add_Page = [{\r
\n
title:'즐겨찾기1',
\r\n
url:'http://localhost:3000',
\r\n
}, {\r
\n
title:'즐겨찾기2',
\r\n
url:'https://www.naver.com/',
\r\n
}, {\r
\n
title:'즐겨찾기3',
\r\n
url:'https://www.youtube.com/watch?v=wo46N-LQK7o'
\r\n
}]
\r\n\r\n
return (
\r\n
<Container>
\r\n
<Navbar bg=
\"
primary
\"
variant=
\"
dark
\"
>
\r\n
<Navbar.Brand href=
\"
/
\"
>북마크</Navbar.Brand>
\r\n
<Nav className=
\"
mr-auto
\"
>
\r\n
<Nav.Link href=
\"
/
\"
>Home</Nav.Link>
\r\n
</Nav>
\r\n
{/* <Form inline>
\r\n
<FormControl type=
\"
text
\"
placeholder=
\"
Search
\"
className=
\"
mr-sm-2
\"
/>
\r\n
<Button variant=
\"
outline-light
\"
>Search</Button>
\r\n
</Form> */}
\r\n
</Navbar>
\r\n
<Form>
\r\n
<ListGroup>
\r\n
<ListGroup.Item action href=
\"\"
>북마크1</ListGroup.Item>
\r\n
<ListGroup.Item>북마크2</ListGroup.Item>
\r\n
</ListGroup>
\r\n
</Form>
\r\n
</Container>
\r\n
)
\r\n
}
\r\n\r\n
export default Bookmark"
,{
"ruleId"
:
"90"
,
"replacedBy"
:
"91"
},{
"ruleId"
:
"92"
,
"replacedBy"
:
"93"
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"95"
,
"line"
:
3
,
"column"
:
33
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
3
,
"endColumn"
:
36
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"98"
,
"line"
:
3
,
"column"
:
46
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
3
,
"endColumn"
:
51
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"99"
,
"line"
:
3
,
"column"
:
53
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
3
,
"endColumn"
:
57
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"100"
,
"line"
:
3
,
"column"
:
59
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
3
,
"endColumn"
:
68
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"101"
,
"line"
:
3
,
"column"
:
70
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
3
,
"endColumn"
:
78
},{
"ruleId"
:
"102"
,
"severity"
:
1
,
"message"
:
"103"
,
"line"
:
20
,
"column"
:
6
,
"nodeType"
:
"104"
,
"endLine"
:
20
,
"endColumn"
:
8
,
"suggestions"
:
"105"
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"106"
,
"line"
:
5
,
"column"
:
83
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
5
,
"endColumn"
:
88
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"107"
,
"line"
:
22
,
"column"
:
12
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
22
,
"endColumn"
:
18
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"108"
,
"line"
:
23
,
"column"
:
12
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
23
,
"endColumn"
:
16
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"109"
,
"line"
:
24
,
"column"
:
18
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
24
,
"endColumn"
:
25
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"110"
,
"line"
:
25
,
"column"
:
12
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
25
,
"endColumn"
:
19
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"111"
,
"line"
:
26
,
"column"
:
12
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
26
,
"endColumn"
:
17
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"112"
,
"line"
:
28
,
"column"
:
11
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
28
,
"endColumn"
:
22
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"113"
,
"line"
:
29
,
"column"
:
11
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
29
,
"endColumn"
:
21
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"114"
,
"line"
:
84
,
"column"
:
19
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
84
,
"endColumn"
:
27
},{
"ruleId"
:
"115"
,
"severity"
:
1
,
"message"
:
"116"
,
"line"
:
106
,
"column"
:
35
,
"nodeType"
:
"117"
,
"endLine"
:
106
,
"endColumn"
:
76
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"118"
,
"line"
:
1
,
"column"
:
17
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
1
,
"endColumn"
:
26
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"119"
,
"line"
:
2
,
"column"
:
10
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
2
,
"endColumn"
:
14
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"120"
,
"line"
:
4
,
"column"
:
64
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
4
,
"endColumn"
:
75
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"121"
,
"line"
:
4
,
"column"
:
77
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
4
,
"endColumn"
:
83
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"118"
,
"line"
:
1
,
"column"
:
27
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
1
,
"endColumn"
:
36
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"122"
,
"line"
:
2
,
"column"
:
10
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
2
,
"endColumn"
:
15
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"95"
,
"line"
:
2
,
"column"
:
17
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
2
,
"endColumn"
:
20
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"99"
,
"line"
:
2
,
"column"
:
22
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
2
,
"endColumn"
:
26
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"123"
,
"line"
:
2
,
"column"
:
45
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
2
,
"endColumn"
:
48
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"124"
,
"line"
:
2
,
"column"
:
50
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
2
,
"endColumn"
:
56
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"125"
,
"line"
:
2
,
"column"
:
82
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
2
,
"endColumn"
:
87
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"126"
,
"line"
:
2
,
"column"
:
89
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
2
,
"endColumn"
:
94
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"127"
,
"line"
:
5
,
"column"
:
10
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
5
,
"endColumn"
:
18
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"110"
,
"line"
:
14
,
"column"
:
12
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
14
,
"endColumn"
:
19
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"111"
,
"line"
:
15
,
"column"
:
12
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
15
,
"endColumn"
:
17
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"128"
,
"line"
:
18
,
"column"
:
14
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
18
,
"endColumn"
:
26
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"129"
,
"line"
:
23
,
"column"
:
20
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
23
,
"endColumn"
:
32
},{
"ruleId"
:
"94"
,
"severity"
:
1
,
"message"
:
"130"
,
"line"
:
38
,
"column"
:
11
,
"nodeType"
:
"96"
,
"messageId"
:
"97"
,
"endLine"
:
38
,
"endColumn"
:
19
},
"no-native-reassign"
,[
"131"
],
"no-negated-in-lhs"
,[
"132"
],
"no-unused-vars"
,
"'Col' is defined but never used."
,
"Identifier"
,
"unusedVar"
,
"'Badge' is defined but never used."
,
"'Card' is defined but never used."
,
"'Accordion' is defined but never used."
,
"'Carousel' is defined but never used."
,
"react-hooks/exhaustive-deps"
,
"React Hook useEffect has a missing dependency: 'getReview'. Either include it or remove the dependency array."
,
"ArrayExpression"
,[
"133"
],
"'Modal' is defined but never used."
,
"'mobile' is assigned a value but never used."
,
"'show' is assigned a value but never used."
,
"'setPage' is assigned a value but never used."
,
"'success' is assigned a value but never used."
,
"'error' is assigned a value but never used."
,
"'handleClose' is assigned a value but never used."
,
"'handleShow' is assigned a value but never used."
,
"'response' is assigned a value but never used."
,
"react/jsx-no-duplicate-props"
,
"No duplicate props allowed"
,
"JSXAttribute"
,
"'useEffect' is defined but never used."
,
"'Link' is defined but never used."
,
"'FormControl' is defined but never used."
,
"'Navbar' is defined but never used."
,
"'Alert' is defined but never used."
,
"'Row' is defined but never used."
,
"'Button' is defined but never used."
,
"'Image' is defined but never used."
,
"'Table' is defined but never used."
,
"'Redirect' is defined but never used."
,
"'handleChange' is defined but never used."
,
"'handleSubmit' is defined but never used."
,
"'add_Page' is assigned a value but never used."
,
"no-global-assign"
,
"no-unsafe-negation"
,{
"desc"
:
"134"
,
"fix"
:
"135"
},
"Update the dependencies array to be: [getReview]"
,{
"range"
:
"136"
,
"text"
:
"137"
},[
581
,
583
],
"[getReview]"
]
\ No newline at end of file
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