Skip to content
Snippets Groups Projects
Commit 559857e3 authored by epson220's avatar epson220
Browse files

error fix writeProfile

parent df21c3c9
Branches
No related tags found
No related merge requests found
[{"C:\\WYH\\frontend\\src\\reportWebVitals.js":"1","C:\\WYH\\frontend\\src\\App.js":"2","C:\\WYH\\frontend\\src\\index.js":"3","C:\\WYH\\frontend\\src\\components\\Profile.js":"4","C:\\WYH\\frontend\\src\\components\\Board.js":"5","C:\\WYH\\frontend\\src\\components\\Home.js":"6","C:\\WYH\\frontend\\src\\components\\Signup.js":"7","C:\\WYH\\frontend\\src\\components\\Login.js":"8","C:\\WYH\\frontend\\src\\components\\WriteBoard.js":"9","C:\\WYH\\frontend\\src\\components\\DetailBoard.js":"10","C:\\WYH\\frontend\\src\\components\\WriteProfile.js":"11"},{"size":362,"mtime":1606157613272,"results":"12","hashOfConfig":"13"},{"size":1757,"mtime":1607358112755,"results":"14","hashOfConfig":"13"},{"size":544,"mtime":1606240034288,"results":"15","hashOfConfig":"13"},{"size":1175,"mtime":1607184077239,"results":"16","hashOfConfig":"13"},{"size":1711,"mtime":1607358800912,"results":"17","hashOfConfig":"13"},{"size":370,"mtime":1606662762631,"results":"18","hashOfConfig":"13"},{"size":1575,"mtime":1607345129868,"results":"19","hashOfConfig":"13"},{"size":1232,"mtime":1606662786263,"results":"20","hashOfConfig":"13"},{"size":3419,"mtime":1607104090152,"results":"21","hashOfConfig":"13"},{"size":2475,"mtime":1607341349582,"results":"22","hashOfConfig":"13"},{"size":3344,"mtime":1607369115634,"results":"23","hashOfConfig":"13"},{"filePath":"24","messages":"25","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"10w9ldj",{"filePath":"26","messages":"27","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"28","messages":"29","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"31","messages":"32","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"33","messages":"34","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"35","messages":"36","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"37","messages":"38","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"39","messages":"40","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"41"},{"filePath":"42","messages":"43","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"44","usedDeprecatedRules":"45"},{"filePath":"46","messages":"47","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"48"},{"filePath":"49","messages":"50","errorCount":0,"warningCount":5,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"C:\\WYH\\frontend\\src\\reportWebVitals.js",[],"C:\\WYH\\frontend\\src\\App.js",["51"],"C:\\WYH\\frontend\\src\\index.js",[],["52","53"],"C:\\WYH\\frontend\\src\\components\\Profile.js",[],"C:\\WYH\\frontend\\src\\components\\Board.js",["54","55"],"C:\\WYH\\frontend\\src\\components\\Home.js",["56"],"C:\\WYH\\frontend\\src\\components\\Signup.js",["57"],"C:\\WYH\\frontend\\src\\components\\Login.js",["58"],"import React, { useState } from \"react\";\r\nimport { post } from \"axios\";\r\n\r\nconst Login = () => {\r\n const [username, setUsername] = useState(\"\");\r\n const [password, setPassword] = useState(\"\");\r\n\r\n const onChangeUsername = (e) => setUsername(e.target.value);\r\n const onChangePassword = (e) => setPassword(e.target.value);\r\n\r\n // const handleFormSubmit = () => {\r\n // const url = \"/login\";\r\n // let formData = new FormData();\r\n // formData.append(\"username\", username);\r\n // formData.append(\"password\", password);\r\n\r\n // let config = {\r\n // headers: {\r\n // \"content-type\": \"multipart/form-data\",\r\n // },\r\n // };\r\n\r\n // return post(url, formData, config);\r\n // };\r\n\r\n return (\r\n <form action=\"http://localhost:3001/login\" method=\"post\">\r\n <h1>로그인 화면</h1>\r\n 이메일:\r\n <input\r\n type=\"text\"\r\n name=\"email\"\r\n value={username}\r\n onChange={onChangeUsername}\r\n ></input>\r\n 비밀번호:\r\n <input\r\n type=\"password\"\r\n name=\"password\"\r\n value={password}\r\n onChange={onChangePassword}\r\n ></input>\r\n <button type=\"submit\">로그인</button>\r\n </form>\r\n );\r\n};\r\n\r\nexport default Login;\r\n","C:\\WYH\\frontend\\src\\components\\WriteBoard.js",["59","60","61","62"],"import React, { useState } from \"react\";\r\n\r\nconst WriteBoard = () => {\r\n const [title, setTitle] = useState(\"\");\r\n const [content, setContent] = useState(\"\");\r\n const [hobby, setHobby] = useState(\"\");\r\n\r\n const onChangeTitle = (e) => setTitle(e.target.value);\r\n const onChangeContent = (e) => setContent(e.target.value);\r\n const onChangeHobby = (e) => setHobby(e.target.value);\r\n\r\n return (\r\n <div>\r\n <form\r\n action=\"http://localhost:3001/writeBoard\"\r\n method=\"post\"\r\n encType=\"multipart/form-data\"\r\n >\r\n <label>제목</label>\r\n <input type=\"text\" name=\"title\" onChange={onChangeTitle}></input>\r\n <br></br>\r\n <label>본문</label>\r\n <textarea\r\n type=\"text\"\r\n name=\"content\"\r\n onChange={onChangeContent}\r\n ></textarea>\r\n <br></br>\r\n <label>취미</label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"ex/sp\" name=\"hobby\" />\r\n 운동/스포츠\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"out/tr\" name=\"hobby\" />\r\n 아웃도어/여행\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"bk/wr\" name=\"hobby\" />\r\n 인문학/책/글\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"fg/lg\" name=\"hobby\" />\r\n 외국/언어\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"cul/pfm\" name=\"hobby\" />\r\n 문화/공연\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"mu/inst\" name=\"hobby\" />\r\n 음악/악기\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"cft\" name=\"hobby\" />\r\n 공예/만들기\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"dan\" name=\"hobby\" />\r\n 댄스/무용\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"volu\" name=\"hobby\" />\r\n 봉사활동\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"par\" name=\"hobby\" />\r\n 사교/인맥\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"game\" name=\"hobby\" />\r\n 게임/오락\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"pic\" name=\"hobby\" />\r\n 사진/편집/촬영/영상\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"inv\" name=\"hobby\" />\r\n 제테크/투자\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"cok/fod\" name=\"hobby\" />\r\n 요리/음식/맛집\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"fas/bea\" name=\"hobby\" />\r\n 패션/뷰티/코디\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"art/draw\" name=\"hobby\" />\r\n 미술/그림\r\n </label>\r\n <br></br>\r\n <br></br>\r\n <label>사진첨부</label>\r\n <input type=\"file\" name=\"photo\"></input>\r\n <br></br>\r\n <button type=\"submit\">ok</button>\r\n </form>\r\n </div>\r\n );\r\n};\r\n\r\nexport default WriteBoard;\r\n",["63","64"],"C:\\WYH\\frontend\\src\\components\\DetailBoard.js",["65","66","67"],"import React, { useEffect, useState } from \"react\";\r\nimport axios from \"axios\";\r\nimport { Link } from \"react-router-dom\";\r\n\r\nconst DetailBoard = ({ match }) => {\r\n const { board_id } = match.params;\r\n const [Board, setBoard] = useState({\r\n title: \"\",\r\n content: \"\",\r\n hobby: \"\",\r\n picture: \"\",\r\n writer: \"\",\r\n created_at: \"\",\r\n _id: \"\",\r\n });\r\n // const [Comments, setComments] = useState({\r\n // _id: \"\",\r\n // board_id: \"\",\r\n // writer: \"\",\r\n // input: \"\",\r\n // });\r\n const [Comments, setComments] = useState([]);\r\n const [Imgurl, setImgurl] = useState(\"\");\r\n const [Comment, setComment] = useState(\"\");\r\n\r\n const onChangeComment = (e) => setComment(e.target.value);\r\n\r\n console.dir(match.params);\r\n console.log(\"board_id : \" + board_id);\r\n\r\n useEffect(async () => {\r\n async function fetchData() {\r\n console.log(\"react detailBoard axios post 호출1\");\r\n let res = await axios.post(\"http://localhost:3001/getDetailBoard\", {\r\n id: board_id,\r\n });\r\n console.log(\"res : \");\r\n console.dir(res);\r\n setBoard(res.data.detailBoard);\r\n console.log(Board);\r\n setComments(res.data.boardComments);\r\n setImgurl(\r\n \"http://localhost:3001/uploads/\" + res.data.detailBoard.picture\r\n );\r\n }\r\n fetchData();\r\n }, []);\r\n\r\n return (\r\n <>\r\n <Link to=\"/profile\">작성자 : {Board.writer}</Link>\r\n <h3 style={{ width: \"50%\", border: \"1px solid black\" }}>{Board.title}</h3>\r\n <div style={{ width: \"80%\", border: \"1px solid black\" }}>\r\n {Board.content}\r\n </div>\r\n <div>\r\n <img src={Imgurl} style={{ width: \"600px\", height: \"600px\" }}></img>\r\n </div>\r\n <div>\r\n <form method=\"post\" action=\"http://localhost:3001/writeComment\">\r\n <input\r\n type=\"text\"\r\n placeholder=\"댓글을 작성해 주세요.\"\r\n name=\"comment\"\r\n value={Comment}\r\n onChange={onChangeComment}\r\n ></input>\r\n <input type=\"hidden\" name=\"writer\" value={Board.writer}></input>\r\n <input type=\"hidden\" name=\"boardId\" value={Board._id}></input>\r\n <button type=\"submit\">작성완료</button>\r\n </form>\r\n </div>\r\n <div>\r\n <ol>\r\n {Comments.map((c) => (\r\n <li key={c._id}>\r\n {c.input} {c.writer}\r\n </li>\r\n ))}\r\n </ol>\r\n </div>\r\n </>\r\n );\r\n};\r\n\r\nexport default DetailBoard;\r\n","C:\\WYH\\frontend\\src\\components\\WriteProfile.js",["68","69","70","71","72"],{"ruleId":"73","severity":1,"message":"74","line":1,"column":17,"nodeType":"75","messageId":"76","endLine":1,"endColumn":26},{"ruleId":"77","replacedBy":"78"},{"ruleId":"79","replacedBy":"80"},{"ruleId":"73","severity":1,"message":"81","line":2,"column":10,"nodeType":"75","messageId":"76","endLine":2,"endColumn":15},{"ruleId":"82","severity":1,"message":"83","line":8,"column":13,"nodeType":"84","endLine":27,"endColumn":4},{"ruleId":"73","severity":1,"message":"81","line":2,"column":10,"nodeType":"75","messageId":"76","endLine":2,"endColumn":15},{"ruleId":"73","severity":1,"message":"85","line":3,"column":10,"nodeType":"75","messageId":"76","endLine":3,"endColumn":14},{"ruleId":"73","severity":1,"message":"85","line":2,"column":10,"nodeType":"75","messageId":"76","endLine":2,"endColumn":14},{"ruleId":"73","severity":1,"message":"86","line":4,"column":10,"nodeType":"75","messageId":"76","endLine":4,"endColumn":15},{"ruleId":"73","severity":1,"message":"87","line":5,"column":10,"nodeType":"75","messageId":"76","endLine":5,"endColumn":17},{"ruleId":"73","severity":1,"message":"88","line":6,"column":10,"nodeType":"75","messageId":"76","endLine":6,"endColumn":15},{"ruleId":"73","severity":1,"message":"89","line":10,"column":9,"nodeType":"75","messageId":"76","endLine":10,"endColumn":22},{"ruleId":"77","replacedBy":"90"},{"ruleId":"79","replacedBy":"91"},{"ruleId":"82","severity":1,"message":"83","line":31,"column":13,"nodeType":"84","endLine":47,"endColumn":4},{"ruleId":"82","severity":1,"message":"92","line":47,"column":6,"nodeType":"93","endLine":47,"endColumn":8,"suggestions":"94"},{"ruleId":"95","severity":1,"message":"96","line":57,"column":9,"nodeType":"97","endLine":57,"endColumn":71},{"ruleId":"73","severity":1,"message":"98","line":16,"column":10,"nodeType":"75","messageId":"76","endLine":16,"endColumn":17},{"ruleId":"73","severity":1,"message":"99","line":33,"column":9,"nodeType":"75","messageId":"76","endLine":33,"endColumn":29},{"ruleId":"82","severity":1,"message":"83","line":39,"column":13,"nodeType":"84","endLine":49,"endColumn":4},{"ruleId":"95","severity":1,"message":"96","line":55,"column":7,"nodeType":"97","endLine":55,"endColumn":51},{"ruleId":"95","severity":1,"message":"96","line":62,"column":7,"nodeType":"97","endLine":62,"endColumn":59},"no-unused-vars","'Component' is defined but never used.","Identifier","unusedVar","no-native-reassign",["100"],"no-negated-in-lhs",["101"],"'Route' is defined but never used.","react-hooks/exhaustive-deps","Effect callbacks are synchronous to prevent race conditions. Put the async function inside:\n\nuseEffect(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching","ArrowFunctionExpression","'post' is defined but never used.","'title' is assigned a value but never used.","'content' is assigned a value but never used.","'hobby' is assigned a value but never used.","'onChangeHobby' is assigned a value but never used.",["100"],["101"],"React Hook useEffect has missing dependencies: 'Board' and 'board_id'. Either include them or remove the dependency array.","ArrayExpression",["102"],"jsx-a11y/alt-text","img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.","JSXOpeningElement","'imgFile' is assigned a value but never used.","'onChangeProfilePhoto' is assigned a value but never used.","no-global-assign","no-unsafe-negation",{"desc":"103","fix":"104"},"Update the dependencies array to be: [Board, board_id]",{"range":"105","text":"106"},[1309,1311],"[Board, board_id]"]
\ No newline at end of file
[{"C:\\WYH\\frontend\\src\\reportWebVitals.js":"1","C:\\WYH\\frontend\\src\\App.js":"2","C:\\WYH\\frontend\\src\\index.js":"3","C:\\WYH\\frontend\\src\\components\\Profile.js":"4","C:\\WYH\\frontend\\src\\components\\Board.js":"5","C:\\WYH\\frontend\\src\\components\\Home.js":"6","C:\\WYH\\frontend\\src\\components\\Signup.js":"7","C:\\WYH\\frontend\\src\\components\\Login.js":"8","C:\\WYH\\frontend\\src\\components\\WriteBoard.js":"9","C:\\WYH\\frontend\\src\\components\\DetailBoard.js":"10","C:\\WYH\\frontend\\src\\components\\WriteProfile.js":"11"},{"size":362,"mtime":1606157613272,"results":"12","hashOfConfig":"13"},{"size":1757,"mtime":1607358112755,"results":"14","hashOfConfig":"13"},{"size":544,"mtime":1606240034288,"results":"15","hashOfConfig":"13"},{"size":1175,"mtime":1607184077239,"results":"16","hashOfConfig":"13"},{"size":1711,"mtime":1607358800912,"results":"17","hashOfConfig":"13"},{"size":370,"mtime":1606662762631,"results":"18","hashOfConfig":"13"},{"size":1575,"mtime":1607345129868,"results":"19","hashOfConfig":"13"},{"size":1232,"mtime":1606662786263,"results":"20","hashOfConfig":"13"},{"size":3419,"mtime":1607104090152,"results":"21","hashOfConfig":"13"},{"size":2475,"mtime":1607341349582,"results":"22","hashOfConfig":"13"},{"size":3396,"mtime":1607369801073,"results":"23","hashOfConfig":"13"},{"filePath":"24","messages":"25","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"10w9ldj",{"filePath":"26","messages":"27","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"28","messages":"29","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"31","messages":"32","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"33","messages":"34","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"35","messages":"36","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"37","messages":"38","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"39","messages":"40","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"41"},{"filePath":"42","messages":"43","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"44","usedDeprecatedRules":"45"},{"filePath":"46","messages":"47","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"48"},{"filePath":"49","messages":"50","errorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"C:\\WYH\\frontend\\src\\reportWebVitals.js",[],"C:\\WYH\\frontend\\src\\App.js",["51"],"C:\\WYH\\frontend\\src\\index.js",[],["52","53"],"C:\\WYH\\frontend\\src\\components\\Profile.js",[],"C:\\WYH\\frontend\\src\\components\\Board.js",["54","55"],"C:\\WYH\\frontend\\src\\components\\Home.js",["56"],"C:\\WYH\\frontend\\src\\components\\Signup.js",["57"],"C:\\WYH\\frontend\\src\\components\\Login.js",["58"],"import React, { useState } from \"react\";\r\nimport { post } from \"axios\";\r\n\r\nconst Login = () => {\r\n const [username, setUsername] = useState(\"\");\r\n const [password, setPassword] = useState(\"\");\r\n\r\n const onChangeUsername = (e) => setUsername(e.target.value);\r\n const onChangePassword = (e) => setPassword(e.target.value);\r\n\r\n // const handleFormSubmit = () => {\r\n // const url = \"/login\";\r\n // let formData = new FormData();\r\n // formData.append(\"username\", username);\r\n // formData.append(\"password\", password);\r\n\r\n // let config = {\r\n // headers: {\r\n // \"content-type\": \"multipart/form-data\",\r\n // },\r\n // };\r\n\r\n // return post(url, formData, config);\r\n // };\r\n\r\n return (\r\n <form action=\"http://localhost:3001/login\" method=\"post\">\r\n <h1>로그인 화면</h1>\r\n 이메일:\r\n <input\r\n type=\"text\"\r\n name=\"email\"\r\n value={username}\r\n onChange={onChangeUsername}\r\n ></input>\r\n 비밀번호:\r\n <input\r\n type=\"password\"\r\n name=\"password\"\r\n value={password}\r\n onChange={onChangePassword}\r\n ></input>\r\n <button type=\"submit\">로그인</button>\r\n </form>\r\n );\r\n};\r\n\r\nexport default Login;\r\n","C:\\WYH\\frontend\\src\\components\\WriteBoard.js",["59","60","61","62"],"import React, { useState } from \"react\";\r\n\r\nconst WriteBoard = () => {\r\n const [title, setTitle] = useState(\"\");\r\n const [content, setContent] = useState(\"\");\r\n const [hobby, setHobby] = useState(\"\");\r\n\r\n const onChangeTitle = (e) => setTitle(e.target.value);\r\n const onChangeContent = (e) => setContent(e.target.value);\r\n const onChangeHobby = (e) => setHobby(e.target.value);\r\n\r\n return (\r\n <div>\r\n <form\r\n action=\"http://localhost:3001/writeBoard\"\r\n method=\"post\"\r\n encType=\"multipart/form-data\"\r\n >\r\n <label>제목</label>\r\n <input type=\"text\" name=\"title\" onChange={onChangeTitle}></input>\r\n <br></br>\r\n <label>본문</label>\r\n <textarea\r\n type=\"text\"\r\n name=\"content\"\r\n onChange={onChangeContent}\r\n ></textarea>\r\n <br></br>\r\n <label>취미</label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"ex/sp\" name=\"hobby\" />\r\n 운동/스포츠\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"out/tr\" name=\"hobby\" />\r\n 아웃도어/여행\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"bk/wr\" name=\"hobby\" />\r\n 인문학/책/글\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"fg/lg\" name=\"hobby\" />\r\n 외국/언어\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"cul/pfm\" name=\"hobby\" />\r\n 문화/공연\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"mu/inst\" name=\"hobby\" />\r\n 음악/악기\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"cft\" name=\"hobby\" />\r\n 공예/만들기\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"dan\" name=\"hobby\" />\r\n 댄스/무용\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"volu\" name=\"hobby\" />\r\n 봉사활동\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"par\" name=\"hobby\" />\r\n 사교/인맥\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"game\" name=\"hobby\" />\r\n 게임/오락\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"pic\" name=\"hobby\" />\r\n 사진/편집/촬영/영상\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"inv\" name=\"hobby\" />\r\n 제테크/투자\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"cok/fod\" name=\"hobby\" />\r\n 요리/음식/맛집\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"fas/bea\" name=\"hobby\" />\r\n 패션/뷰티/코디\r\n </label>\r\n <br></br>\r\n <label>\r\n <input type=\"radio\" value=\"art/draw\" name=\"hobby\" />\r\n 미술/그림\r\n </label>\r\n <br></br>\r\n <br></br>\r\n <label>사진첨부</label>\r\n <input type=\"file\" name=\"photo\"></input>\r\n <br></br>\r\n <button type=\"submit\">ok</button>\r\n </form>\r\n </div>\r\n );\r\n};\r\n\r\nexport default WriteBoard;\r\n",["63","64"],"C:\\WYH\\frontend\\src\\components\\DetailBoard.js",["65","66","67"],"import React, { useEffect, useState } from \"react\";\r\nimport axios from \"axios\";\r\nimport { Link } from \"react-router-dom\";\r\n\r\nconst DetailBoard = ({ match }) => {\r\n const { board_id } = match.params;\r\n const [Board, setBoard] = useState({\r\n title: \"\",\r\n content: \"\",\r\n hobby: \"\",\r\n picture: \"\",\r\n writer: \"\",\r\n created_at: \"\",\r\n _id: \"\",\r\n });\r\n // const [Comments, setComments] = useState({\r\n // _id: \"\",\r\n // board_id: \"\",\r\n // writer: \"\",\r\n // input: \"\",\r\n // });\r\n const [Comments, setComments] = useState([]);\r\n const [Imgurl, setImgurl] = useState(\"\");\r\n const [Comment, setComment] = useState(\"\");\r\n\r\n const onChangeComment = (e) => setComment(e.target.value);\r\n\r\n console.dir(match.params);\r\n console.log(\"board_id : \" + board_id);\r\n\r\n useEffect(async () => {\r\n async function fetchData() {\r\n console.log(\"react detailBoard axios post 호출1\");\r\n let res = await axios.post(\"http://localhost:3001/getDetailBoard\", {\r\n id: board_id,\r\n });\r\n console.log(\"res : \");\r\n console.dir(res);\r\n setBoard(res.data.detailBoard);\r\n console.log(Board);\r\n setComments(res.data.boardComments);\r\n setImgurl(\r\n \"http://localhost:3001/uploads/\" + res.data.detailBoard.picture\r\n );\r\n }\r\n fetchData();\r\n }, []);\r\n\r\n return (\r\n <>\r\n <Link to=\"/profile\">작성자 : {Board.writer}</Link>\r\n <h3 style={{ width: \"50%\", border: \"1px solid black\" }}>{Board.title}</h3>\r\n <div style={{ width: \"80%\", border: \"1px solid black\" }}>\r\n {Board.content}\r\n </div>\r\n <div>\r\n <img src={Imgurl} style={{ width: \"600px\", height: \"600px\" }}></img>\r\n </div>\r\n <div>\r\n <form method=\"post\" action=\"http://localhost:3001/writeComment\">\r\n <input\r\n type=\"text\"\r\n placeholder=\"댓글을 작성해 주세요.\"\r\n name=\"comment\"\r\n value={Comment}\r\n onChange={onChangeComment}\r\n ></input>\r\n <input type=\"hidden\" name=\"writer\" value={Board.writer}></input>\r\n <input type=\"hidden\" name=\"boardId\" value={Board._id}></input>\r\n <button type=\"submit\">작성완료</button>\r\n </form>\r\n </div>\r\n <div>\r\n <ol>\r\n {Comments.map((c) => (\r\n <li key={c._id}>\r\n {c.input} {c.writer}\r\n </li>\r\n ))}\r\n </ol>\r\n </div>\r\n </>\r\n );\r\n};\r\n\r\nexport default DetailBoard;\r\n","C:\\WYH\\frontend\\src\\components\\WriteProfile.js",["68","69","70","71","72","73"],{"ruleId":"74","severity":1,"message":"75","line":1,"column":17,"nodeType":"76","messageId":"77","endLine":1,"endColumn":26},{"ruleId":"78","replacedBy":"79"},{"ruleId":"80","replacedBy":"81"},{"ruleId":"74","severity":1,"message":"82","line":2,"column":10,"nodeType":"76","messageId":"77","endLine":2,"endColumn":15},{"ruleId":"83","severity":1,"message":"84","line":8,"column":13,"nodeType":"85","endLine":27,"endColumn":4},{"ruleId":"74","severity":1,"message":"82","line":2,"column":10,"nodeType":"76","messageId":"77","endLine":2,"endColumn":15},{"ruleId":"74","severity":1,"message":"86","line":3,"column":10,"nodeType":"76","messageId":"77","endLine":3,"endColumn":14},{"ruleId":"74","severity":1,"message":"86","line":2,"column":10,"nodeType":"76","messageId":"77","endLine":2,"endColumn":14},{"ruleId":"74","severity":1,"message":"87","line":4,"column":10,"nodeType":"76","messageId":"77","endLine":4,"endColumn":15},{"ruleId":"74","severity":1,"message":"88","line":5,"column":10,"nodeType":"76","messageId":"77","endLine":5,"endColumn":17},{"ruleId":"74","severity":1,"message":"89","line":6,"column":10,"nodeType":"76","messageId":"77","endLine":6,"endColumn":15},{"ruleId":"74","severity":1,"message":"90","line":10,"column":9,"nodeType":"76","messageId":"77","endLine":10,"endColumn":22},{"ruleId":"78","replacedBy":"91"},{"ruleId":"80","replacedBy":"92"},{"ruleId":"83","severity":1,"message":"84","line":31,"column":13,"nodeType":"85","endLine":47,"endColumn":4},{"ruleId":"83","severity":1,"message":"93","line":47,"column":6,"nodeType":"94","endLine":47,"endColumn":8,"suggestions":"95"},{"ruleId":"96","severity":1,"message":"97","line":57,"column":9,"nodeType":"98","endLine":57,"endColumn":71},{"ruleId":"74","severity":1,"message":"99","line":16,"column":10,"nodeType":"76","messageId":"77","endLine":16,"endColumn":17},{"ruleId":"74","severity":1,"message":"100","line":33,"column":9,"nodeType":"76","messageId":"77","endLine":33,"endColumn":29},{"ruleId":"83","severity":1,"message":"84","line":39,"column":13,"nodeType":"85","endLine":51,"endColumn":4},{"ruleId":"101","severity":1,"message":"102","line":45,"column":23,"nodeType":"103","messageId":"104","endLine":45,"endColumn":25},{"ruleId":"96","severity":1,"message":"97","line":57,"column":7,"nodeType":"98","endLine":57,"endColumn":51},{"ruleId":"96","severity":1,"message":"97","line":64,"column":7,"nodeType":"98","endLine":64,"endColumn":59},"no-unused-vars","'Component' is defined but never used.","Identifier","unusedVar","no-native-reassign",["105"],"no-negated-in-lhs",["106"],"'Route' is defined but never used.","react-hooks/exhaustive-deps","Effect callbacks are synchronous to prevent race conditions. Put the async function inside:\n\nuseEffect(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching","ArrowFunctionExpression","'post' is defined but never used.","'title' is assigned a value but never used.","'content' is assigned a value but never used.","'hobby' is assigned a value but never used.","'onChangeHobby' is assigned a value but never used.",["105"],["106"],"React Hook useEffect has missing dependencies: 'Board' and 'board_id'. Either include them or remove the dependency array.","ArrayExpression",["107"],"jsx-a11y/alt-text","img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.","JSXOpeningElement","'imgFile' is assigned a value but never used.","'onChangeProfilePhoto' is assigned a value but never used.","eqeqeq","Expected '!==' and instead saw '!='.","BinaryExpression","unexpected","no-global-assign","no-unsafe-negation",{"desc":"108","fix":"109"},"Update the dependencies array to be: [Board, board_id]",{"range":"110","text":"111"},[1309,1311],"[Board, board_id]"]
\ No newline at end of file
......@@ -42,9 +42,11 @@ const WriteProfile = () => {
let res = await axios.get("http://localhost:3001/getProfileInfo");
console.log(res);
console.dir(res.data[0]);
if (res.data[0] != undefined) {
setProfile(res.data[0]);
setImg("http://localhost:3001/uploads/" + res.data[0].profile_photo);
}
}
fetchData();
}, []);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment