[{"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\\Login.js":"3","C:\\Users\\hello\\Desktop\\project\\search-page\\client\\src\\utils\\catchErrors.js":"4","C:\\Users\\hello\\Desktop\\project\\search-page\\client\\src\\Components\\Signup.js":"5","C:\\Users\\hello\\Desktop\\project\\search-page\\client\\src\\utils\\auth.js":"6","C:\\Users\\hello\\Desktop\\project\\search-page\\client\\src\\Components\\Paginations.js":"7","C:\\Users\\hello\\Desktop\\project\\search-page\\client\\src\\Components\\PrivateRoute.js":"8","C:\\Users\\hello\\Desktop\\project\\search-page\\client\\src\\Bookmark.js":"9","C:\\Users\\hello\\Desktop\\project\\search-page\\client\\src\\Pages\\Search.js":"10","C:\\Users\\hello\\Desktop\\project\\search-page\\client\\src\\Pages\\App.js":"11","C:\\Users\\hello\\Desktop\\project\\search-page\\client\\src\\Pages\\Place.js":"12"},{"size":1339,"mtime":1611985207838,"results":"13","hashOfConfig":"14"},{"size":362,"mtime":499162500000,"results":"15","hashOfConfig":"14"},{"size":3150,"mtime":1612140862810,"results":"16","hashOfConfig":"14"},{"size":405,"mtime":1609915408569,"results":"17","hashOfConfig":"14"},{"size":2959,"mtime":1611699671429,"results":"18","hashOfConfig":"14"},{"size":766,"mtime":1612140862813,"results":"19","hashOfConfig":"14"},{"size":3724,"mtime":1612098437239,"results":"20","hashOfConfig":"14"},{"size":438,"mtime":1611699613873,"results":"21","hashOfConfig":"14"},{"size":5611,"mtime":1612141129898,"results":"22","hashOfConfig":"14"},{"size":8312,"mtime":1612141089179,"results":"23","hashOfConfig":"14"},{"size":4954,"mtime":1612141322711,"results":"24","hashOfConfig":"14"},{"size":2452,"mtime":1612141596380,"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":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"28"},{"filePath":"33","messages":"34","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"28"},{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"28"},{"filePath":"37","messages":"38","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"28"},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"28"},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"28"},{"filePath":"43","messages":"44","errorCount":0,"warningCount":12,"fixableErrorCount":0,"fixableWarningCount":0,"source":"45","usedDeprecatedRules":"28"},{"filePath":"46","messages":"47","errorCount":0,"warningCount":14,"fixableErrorCount":0,"fixableWarningCount":0,"source":"48","usedDeprecatedRules":"28"},{"filePath":"49","messages":"50","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"51","messages":"52","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"C:\\Users\\hello\\Desktop\\project\\search-page\\client\\src\\index.js",[],["53","54"],"C:\\Users\\hello\\Desktop\\project\\search-page\\client\\src\\reportWebVitals.js",[],"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\\Components\\PrivateRoute.js",[],"C:\\Users\\hello\\Desktop\\project\\search-page\\client\\src\\Bookmark.js",["55","56","57","58","59","60","61","62","63","64","65","66"],"import React, { useState, useEffect } from 'react'\r\nimport { Alert, Col, Card, Container, Form, Row, Button, Nav, Navbar } from \"react-bootstrap\"\r\nimport axios from \"axios\"\r\nimport catchErrors from './utils/catchErrors.js'\r\nimport { isAuthenticated } from './utils/auth'\r\nimport * as Icon from 'react-bootstrap-icons';\r\nimport Place from './Pages/Place.js'\r\n\r\n\r\nconst INIT_PAGE = {\r\n bookmark: []\r\n}\r\n\r\n\r\nfunction Bookmark() {\r\n const [page, setPage] = useState(INIT_PAGE)\r\n const [index, setIndex] = useState(1);\r\n const [error, setError] = useState('')\r\n const [state, setState] = useState(false);\r\n const [bookmark, setBookmark] = useState([false, false, false, false])\r\n const [pagePlace, setPagePlace] = useState([])\r\n const [showSet, setShowSet] = useState([false, false, false, false]);\r\n\r\n const user = isAuthenticated()\r\n\r\n async function getBookmark() {\r\n try {\r\n const response = await axios.get(`/api/users/bookmark?ID=${user}`)\r\n setPagePlace(response.data.bookmark)\r\n } catch (error) {\r\n catchErrors(error, setError)\r\n }\r\n }\r\n\r\n\r\n async function handleBookmark(index) {\r\n if (!bookmark[index]) {\r\n console.log(pagePlace[index])\r\n try {\r\n const response = await axios.put(`/api/users/bookmark?ID=${user}&place=${pagePlace[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}`)\r\n alert(response.data, '저장된 북마크가 삭제되었습니다.')\r\n const showArr = bookmark\r\n showArr[index] = false\r\n setBookmark(showArr)\r\n console.log(\"bookmark=\", bookmark)\r\n } catch (error) {\r\n catchErrors(error, setError)\r\n }\r\n }\r\n }\r\n useEffect(() => {\r\n getBookmark()\r\n }, [])\r\n\r\n\r\n return (\r\n \r\n \r\n 북마크\r\n \r\n \r\n \r\n {console.log(\"#####################33\", pagePlace)}\r\n {pagePlace.map((place, index) => {\r\n return (\r\n \r\n \r\n\r\n {place.name}\r\n {user ?\r\n handleBookmark(index, place)}>\r\n \r\n {console.log(\"bookmark\", bookmark)}\r\n {console.log(\"bookmark[index]\", bookmark[index])} : null}\r\n \r\n \r\n \r\n \r\n {place.address} \r\n \r\n {/* setShowSet([false, false, false, false])} /> */}\r\n \r\n \r\n \r\n )\r\n })}\r\n\r\n\r\n \r\n \r\n )\r\n}\r\n\r\nexport 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\\hello\\Desktop\\project\\search-page\\client\\src\\Pages\\Search.js",["67","68","69","70","71","72","73","74","75","76","77","78","79","80"],"import React, { useState, useEffect } from 'react';\r\nimport { Link } from 'react-router-dom';\r\nimport ohuh from '../ohuh-sm.PNG';\r\nimport Place from '../Pages/Place.js';\r\nimport { Container, Form, Row, Col, Card, Image, InputGroup, FormControl, Button, Nav } from 'react-bootstrap';\r\nimport Paginations from '../Components/Paginations';\r\nimport axios from 'axios';\r\nimport queryString from 'query-string'\r\nimport * as Icon from 'react-bootstrap-icons';\r\nimport { isAuthenticated } from '../utils/auth';\r\nimport catchErrors from '../utils/catchErrors'\r\n\r\nfunction Search(props) {\r\n\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(queryString.parse(props.location.search).keyword);\r\n const [bookmark, setBookmark] = useState([false, false, false, false])\r\n const user = isAuthenticated()\r\n const [mobile, setMobile] = useState();\r\n const [association, setAssociation] = useState([{ name: \" \", address: \" \", img: \" \" }])\r\n const [pagePlace, setPagePlace] = useState([{ name: \" \", address: \" \", img: \" \" }, { name: \" \", address: \" \", img: \" \" }])\r\n const [endPage, setEndPage] = useState(1)\r\n const [error, setError] = useState('')\r\n\r\n async function getBookmark() {\r\n try {\r\n const response = await axios.get(`/api/users/bookmark?ID=${user}`)\r\n // setBookmark(response.data.bookmark)\r\n } catch (error) {\r\n catchErrors(error, setError)\r\n }\r\n }\r\n\r\n const getAssociation = () => {\r\n axios.get(`/api/search/association?keyword=${search}`)\r\n .then(res => {\r\n console.log(\"Associations = \", res.data)\r\n setAssociation(res.data)\r\n })\r\n .catch(err => {\r\n console.log(\"search.associations 에러 발생\", err)\r\n })\r\n }\r\n\r\n\r\n\r\n useEffect(() => {\r\n getAssociation()\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (association.length < 3) {\r\n setPagePlace(paginate(association, index, association.length))\r\n }\r\n else {\r\n setPagePlace(paginate(association, index, 4))\r\n }\r\n setEndPage(Math.floor((association.length / 4)))\r\n console.log(\"7489309484839\", endPage)\r\n\r\n }, [association, index])\r\n\r\n useEffect(() => {\r\n getAssociation()\r\n if (state) {\r\n // window.location.reload()\r\n // return ;\r\n props.history.push('/search?keyword=' + search)\r\n setState(false)\r\n // console.log(\"search야\", search)\r\n } window.addEventListener(\"scroll\", infiniteScroll);\r\n return () => { window.removeEventListener(\"scroll\", infiniteScroll); }\r\n }, [state]);\r\n\r\n const infiniteScroll = () => {\r\n const { documentElement, body } = document;\r\n const scrollHeight = Math.max(documentElement.scrollHeight, body.scrollHeight);\r\n const scrollTop = Math.max(documentElement.scrollTop, body.scrollTop);\r\n const clientHeight = documentElement.clientHeight;\r\n if (scrollTop + clientHeight >= scrollHeight) {\r\n // getReview();\r\n console.log(\"더불러\")\r\n }\r\n console.log(scrollHeight, scrollTop, clientHeight)\r\n }\r\n\r\n\r\n if (state !== false) {\r\n // console.log(queryString.parse(props.location.search))\r\n // = {keyword:search}\r\n // return ;\r\n // history.pushState(null, null, \"?\"+queryParams.toString());\r\n // return ;\r\n }\r\n\r\n const handlePage = (num) => {\r\n setIndex(num);\r\n console.log(\"pagenation num\", num)\r\n console.log(index)\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 = (e) => {\r\n e.preventDefault()\r\n setState(true)\r\n setIndex(1)\r\n }\r\n\r\n function paginate(items, pageNumber, itemNumber) {\r\n const page = [];\r\n const startIndex = (pageNumber - 1) * itemNumber\r\n for (var i = 0; i < itemNumber; i++) {\r\n\r\n page.push(items[(startIndex + i)])\r\n }\r\n console.log(\"뿌릴 data22222222222222222\", page)\r\n return page\r\n }\r\n //usestate 쓰거나 한번에 useeffect에 넣기\r\n\r\n async function handlebookmark(index) {\r\n if (!bookmark[index]) {\r\n console.log(pagePlace[index])\r\n try {\r\n const response = await axios.put(`/api/users/bookmark?ID=${user}&place=${pagePlace[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=${pagePlace[index]._id}`)\r\n alert(response.data, '저장된 북마크가 삭제되었습니다.')\r\n const showArr = bookmark\r\n showArr[index] = false\r\n setBookmark(showArr)\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\r\n let time = new Date()\r\n\r\n return (\r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n {/* {time.toLocaleString()} */}\r\n \r\n\r\n {console.log(\"#####################33\", pagePlace)}\r\n {pagePlace.map((place, index) => {\r\n return (\r\n \r\n \r\n\r\n {place.name}\r\n {user ?\r\n handlebookmark(index, place)}>\r\n \r\n : null}\r\n \r\n \r\n \r\n \r\n {place.address} \r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n })}\r\n \r\n \r\n \r\n \r\n
\r\n );\r\n}\r\n\r\nexport default Search;\r\n","C:\\Users\\hello\\Desktop\\project\\search-page\\client\\src\\Pages\\App.js",["81"],"C:\\Users\\hello\\Desktop\\project\\search-page\\client\\src\\Pages\\Place.js",["82"],{"ruleId":"83","replacedBy":"84"},{"ruleId":"85","replacedBy":"86"},{"ruleId":"87","severity":1,"message":"88","line":2,"column":10,"nodeType":"89","messageId":"90","endLine":2,"endColumn":15},{"ruleId":"87","severity":1,"message":"91","line":2,"column":39,"nodeType":"89","messageId":"90","endLine":2,"endColumn":43},{"ruleId":"87","severity":1,"message":"92","line":7,"column":8,"nodeType":"89","messageId":"90","endLine":7,"endColumn":13},{"ruleId":"87","severity":1,"message":"93","line":16,"column":12,"nodeType":"89","messageId":"90","endLine":16,"endColumn":16},{"ruleId":"87","severity":1,"message":"94","line":16,"column":18,"nodeType":"89","messageId":"90","endLine":16,"endColumn":25},{"ruleId":"87","severity":1,"message":"95","line":17,"column":12,"nodeType":"89","messageId":"90","endLine":17,"endColumn":17},{"ruleId":"87","severity":1,"message":"96","line":17,"column":19,"nodeType":"89","messageId":"90","endLine":17,"endColumn":27},{"ruleId":"87","severity":1,"message":"97","line":18,"column":12,"nodeType":"89","messageId":"90","endLine":18,"endColumn":17},{"ruleId":"87","severity":1,"message":"98","line":19,"column":12,"nodeType":"89","messageId":"90","endLine":19,"endColumn":17},{"ruleId":"87","severity":1,"message":"99","line":19,"column":19,"nodeType":"89","messageId":"90","endLine":19,"endColumn":27},{"ruleId":"87","severity":1,"message":"100","line":22,"column":12,"nodeType":"89","messageId":"90","endLine":22,"endColumn":19},{"ruleId":"101","severity":1,"message":"102","line":64,"column":8,"nodeType":"103","endLine":64,"endColumn":10,"suggestions":"104"},{"ruleId":"87","severity":1,"message":"92","line":4,"column":8,"nodeType":"89","messageId":"90","endLine":4,"endColumn":13},{"ruleId":"87","severity":1,"message":"105","line":5,"column":83,"nodeType":"89","messageId":"90","endLine":5,"endColumn":86},{"ruleId":"87","severity":1,"message":"100","line":17,"column":12,"nodeType":"89","messageId":"90","endLine":17,"endColumn":19},{"ruleId":"87","severity":1,"message":"106","line":17,"column":21,"nodeType":"89","messageId":"90","endLine":17,"endColumn":31},{"ruleId":"87","severity":1,"message":"107","line":21,"column":12,"nodeType":"89","messageId":"90","endLine":21,"endColumn":18},{"ruleId":"87","severity":1,"message":"108","line":21,"column":20,"nodeType":"89","messageId":"90","endLine":21,"endColumn":29},{"ruleId":"87","severity":1,"message":"97","line":25,"column":12,"nodeType":"89","messageId":"90","endLine":25,"endColumn":17},{"ruleId":"87","severity":1,"message":"109","line":27,"column":20,"nodeType":"89","messageId":"90","endLine":27,"endColumn":31},{"ruleId":"87","severity":1,"message":"110","line":29,"column":19,"nodeType":"89","messageId":"90","endLine":29,"endColumn":27},{"ruleId":"101","severity":1,"message":"111","line":51,"column":8,"nodeType":"103","endLine":51,"endColumn":10,"suggestions":"112"},{"ruleId":"101","severity":1,"message":"113","line":63,"column":8,"nodeType":"103","endLine":63,"endColumn":28,"suggestions":"114"},{"ruleId":"101","severity":1,"message":"115","line":78,"column":8,"nodeType":"103","endLine":78,"endColumn":15,"suggestions":"116"},{"ruleId":"87","severity":1,"message":"117","line":161,"column":9,"nodeType":"89","messageId":"90","endLine":161,"endColumn":13},{"ruleId":"118","severity":1,"message":"119","line":166,"column":35,"nodeType":"120","endLine":166,"endColumn":76},{"ruleId":"87","severity":1,"message":"92","line":7,"column":8,"nodeType":"89","messageId":"90","endLine":7,"endColumn":13},{"ruleId":"101","severity":1,"message":"121","line":36,"column":6,"nodeType":"103","endLine":36,"endColumn":8,"suggestions":"122"},"no-native-reassign",["123"],"no-negated-in-lhs",["124"],"no-unused-vars","'Alert' is defined but never used.","Identifier","unusedVar","'Form' is defined but never used.","'Place' is defined but never used.","'page' is assigned a value but never used.","'setPage' is assigned a value but never used.","'index' is assigned a value but never used.","'setIndex' is assigned a value but never used.","'error' is assigned a value but never used.","'state' is assigned a value but never used.","'setState' is assigned a value but never used.","'showSet' is assigned a value but never used.","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'getBookmark'. Either include it or remove the dependency array.","ArrayExpression",["125"],"'Nav' is defined but never used.","'setShowSet' is assigned a value but never used.","'mobile' is assigned a value but never used.","'setMobile' is assigned a value but never used.","'getBookmark' is defined but never used.","'response' is assigned a value but never used.","React Hook useEffect has a missing dependency: 'getAssociation'. Either include it or remove the dependency array.",["126"],"React Hook useEffect has a missing dependency: 'endPage'. Either include it or remove the dependency array.",["127"],"React Hook useEffect has missing dependencies: 'getAssociation', 'props.history', and 'search'. Either include them or remove the dependency array.",["128"],"'time' is assigned a value but never used.","react/jsx-no-duplicate-props","No duplicate props allowed","JSXAttribute","React Hook useEffect has missing dependencies: 'getReview' and 'infiniteScroll'. Either include them or remove the dependency array.",["129"],"no-global-assign","no-unsafe-negation",{"desc":"130","fix":"131"},{"desc":"132","fix":"133"},{"desc":"134","fix":"135"},{"desc":"136","fix":"137"},{"desc":"138","fix":"139"},"Update the dependencies array to be: [getBookmark]",{"range":"140","text":"141"},"Update the dependencies array to be: [getAssociation]",{"range":"142","text":"143"},"Update the dependencies array to be: [association, endPage, index]",{"range":"144","text":"145"},"Update the dependencies array to be: [getAssociation, props.history, search, state]",{"range":"146","text":"147"},"Update the dependencies array to be: [getReview, infiniteScroll]",{"range":"148","text":"149"},[2220,2222],"[getBookmark]",[2006,2008],"[getAssociation]",[2363,2383],"[association, endPage, index]",[2962,2969],"[getAssociation, props.history, search, state]",[1181,1183],"[getReview, infiniteScroll]"]