[{"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\nimport { Col, Card, Container, Row, Button, Image } from \"react-bootstrap\"\r\nimport axios from \"axios\"\r\nimport ohuh from '../ohuh-sm.PNG';\r\nimport catchErrors from '../utils/catchErrors.js'\r\nimport { isAuthenticated } from '../utils/auth'\r\nimport * as Icon from 'react-bootstrap-icons';\r\nimport { Link } from 'react-router-dom'\r\nimport Paginations from '../Components/Paginations';\r\nimport _ from 'lodash';\r\n\r\n\r\n\r\n\r\nfunction 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 \r\n \r\n
\r\n
\r\n

북마크

\r\n
\r\n
\r\n \r\n {console.log(\"#####################33\", bookmarkPlace)}\r\n {pagePlace.map((place, index) => {\r\n return (\r\n \r\n \r\n\r\n \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 {place.name}\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 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]"]