Skip to content
Snippets Groups Projects
Commit 5a28897f authored by epson220's avatar epson220
Browse files

WriteProfile 렌더안됨 ㅠㅠ

parent 99a0f4ab
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":1460,"mtime":1607351770511,"results":"14","hashOfConfig":"13"},{"size":544,"mtime":1606240034288,"results":"15","hashOfConfig":"13"},{"size":1175,"mtime":1607184077239,"results":"16","hashOfConfig":"13"},{"size":1713,"mtime":1607345137100,"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":1513,"mtime":1607353180173,"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},{"filePath":"33","messages":"34","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"35","usedDeprecatedRules":"30"},{"filePath":"36","messages":"37","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"38","messages":"39","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"40","messages":"41","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"42"},{"filePath":"43","messages":"44","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"45","usedDeprecatedRules":"30"},{"filePath":"46","messages":"47","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"48"},{"filePath":"49","messages":"50","errorCount":0,"warningCount":1,"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"],"import React, { useEffect, useState } from \"react\";\r\nimport { Route, Link } from \"react-router-dom\";\r\nimport axios from \"axios\";\r\n\r\nconst Board = () => {\r\n const [response, setResponse] = useState([]);\r\n\r\n useEffect(async () => {\r\n // try {\r\n // console.log(\"axios 실행\");\r\n // let res = [];\r\n // res = await axios.get(\"http://localhost:3001/board\");\r\n // console.log(res);\r\n // setResponse(res.data);\r\n // console.log(response);\r\n // } catch (err) {\r\n // console.log(\"axios err\");\r\n // console.log(err);\r\n // }\r\n async function fetchData() {\r\n console.log(\"react board get axios 호출\");\r\n const result = await axios.get(\"http://localhost:3001/board\");\r\n console.log(result.data);\r\n setResponse(result.data);\r\n }\r\n fetchData();\r\n }, []);\r\n\r\n return (\r\n <div>\r\n <button>\r\n <Link to=\"/writeBoard\">게시글 작성</Link>\r\n </button>\r\n <button>\r\n <Link to=\"/writeProfile\">프로필 작성</Link>\r\n </button>\r\n <form action=\"http://localhost:3001/searchBoard\" method=\"post\">\r\n <input type=\"text\" name=\"searchKeyword\"></input>\r\n <button type=\"submit\">게시글검색</button>\r\n </form>\r\n <ol>\r\n {response.map((res) => (\r\n <li key={res._id}>\r\n {/* <Link to={`/detailBoard/${res._id}`}>\r\n <div onClick={handleOnClick(res._id)}>\r\n {res.title} {res.created_at}\r\n </div>\r\n </Link> */}\r\n <Link to={`/detailBoard/${res._id}`}>\r\n {res.title} {res.created_at}\r\n </Link>\r\n </li>\r\n ))}\r\n </ol>\r\n </div>\r\n );\r\n};\r\n\r\nexport default Board;\r\n","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","C:\\WYH\\frontend\\src\\components\\DetailBoard.js",["63","64","65"],"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",["66"],{"ruleId":"67","severity":1,"message":"68","line":1,"column":17,"nodeType":"69","messageId":"70","endLine":1,"endColumn":26},{"ruleId":"71","replacedBy":"72"},{"ruleId":"73","replacedBy":"74"},{"ruleId":"67","severity":1,"message":"75","line":2,"column":10,"nodeType":"69","messageId":"70","endLine":2,"endColumn":15},{"ruleId":"76","severity":1,"message":"77","line":8,"column":13,"nodeType":"78","endLine":27,"endColumn":4},{"ruleId":"67","severity":1,"message":"75","line":2,"column":10,"nodeType":"69","messageId":"70","endLine":2,"endColumn":15},{"ruleId":"67","severity":1,"message":"79","line":3,"column":10,"nodeType":"69","messageId":"70","endLine":3,"endColumn":14},{"ruleId":"67","severity":1,"message":"79","line":2,"column":10,"nodeType":"69","messageId":"70","endLine":2,"endColumn":14},{"ruleId":"67","severity":1,"message":"80","line":4,"column":10,"nodeType":"69","messageId":"70","endLine":4,"endColumn":15},{"ruleId":"67","severity":1,"message":"81","line":5,"column":10,"nodeType":"69","messageId":"70","endLine":5,"endColumn":17},{"ruleId":"67","severity":1,"message":"82","line":6,"column":10,"nodeType":"69","messageId":"70","endLine":6,"endColumn":15},{"ruleId":"67","severity":1,"message":"83","line":10,"column":9,"nodeType":"69","messageId":"70","endLine":10,"endColumn":22},{"ruleId":"76","severity":1,"message":"77","line":31,"column":13,"nodeType":"78","endLine":47,"endColumn":4},{"ruleId":"76","severity":1,"message":"84","line":47,"column":6,"nodeType":"85","endLine":47,"endColumn":8,"suggestions":"86"},{"ruleId":"87","severity":1,"message":"88","line":57,"column":9,"nodeType":"89","endLine":57,"endColumn":71},{"ruleId":"76","severity":1,"message":"77","line":15,"column":13,"nodeType":"78","endLine":23,"endColumn":4},"no-unused-vars","'Component' is defined but never used.","Identifier","unusedVar","no-native-reassign",["90"],"no-negated-in-lhs",["91"],"'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.","React Hook useEffect has missing dependencies: 'Board' and 'board_id'. Either include them or remove the dependency array.","ArrayExpression",["92"],"jsx-a11y/alt-text","img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.","JSXOpeningElement","no-global-assign","no-unsafe-negation",{"desc":"93","fix":"94"},"Update the dependencies array to be: [Board, board_id]",{"range":"95","text":"96"},[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":1771,"mtime":1607356849697,"results":"14","hashOfConfig":"13"},{"size":544,"mtime":1606240034288,"results":"15","hashOfConfig":"13"},{"size":1175,"mtime":1607184077239,"results":"16","hashOfConfig":"13"},{"size":1712,"mtime":1607356825282,"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":1882,"mtime":1607355088805,"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},{"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":"30"},{"filePath":"45","messages":"46","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"47"},{"filePath":"48","messages":"49","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"C:\\WYH\\frontend\\src\\reportWebVitals.js",[],"C:\\WYH\\frontend\\src\\App.js",["50"],"C:\\WYH\\frontend\\src\\index.js",[],["51","52"],"C:\\WYH\\frontend\\src\\components\\Profile.js",[],"C:\\WYH\\frontend\\src\\components\\Board.js",["53","54"],"C:\\WYH\\frontend\\src\\components\\Home.js",["55"],"C:\\WYH\\frontend\\src\\components\\Signup.js",["56"],"C:\\WYH\\frontend\\src\\components\\Login.js",["57"],"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",["58","59","60","61"],"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","C:\\WYH\\frontend\\src\\components\\DetailBoard.js",["62","63","64"],"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",["65","66","67"],{"ruleId":"68","severity":1,"message":"69","line":1,"column":17,"nodeType":"70","messageId":"71","endLine":1,"endColumn":26},{"ruleId":"72","replacedBy":"73"},{"ruleId":"74","replacedBy":"75"},{"ruleId":"68","severity":1,"message":"76","line":2,"column":10,"nodeType":"70","messageId":"71","endLine":2,"endColumn":15},{"ruleId":"77","severity":1,"message":"78","line":8,"column":13,"nodeType":"79","endLine":27,"endColumn":4},{"ruleId":"68","severity":1,"message":"76","line":2,"column":10,"nodeType":"70","messageId":"71","endLine":2,"endColumn":15},{"ruleId":"68","severity":1,"message":"80","line":3,"column":10,"nodeType":"70","messageId":"71","endLine":3,"endColumn":14},{"ruleId":"68","severity":1,"message":"80","line":2,"column":10,"nodeType":"70","messageId":"71","endLine":2,"endColumn":14},{"ruleId":"68","severity":1,"message":"81","line":4,"column":10,"nodeType":"70","messageId":"71","endLine":4,"endColumn":15},{"ruleId":"68","severity":1,"message":"82","line":5,"column":10,"nodeType":"70","messageId":"71","endLine":5,"endColumn":17},{"ruleId":"68","severity":1,"message":"83","line":6,"column":10,"nodeType":"70","messageId":"71","endLine":6,"endColumn":15},{"ruleId":"68","severity":1,"message":"84","line":10,"column":9,"nodeType":"70","messageId":"71","endLine":10,"endColumn":22},{"ruleId":"77","severity":1,"message":"78","line":31,"column":13,"nodeType":"79","endLine":47,"endColumn":4},{"ruleId":"77","severity":1,"message":"85","line":47,"column":6,"nodeType":"86","endLine":47,"endColumn":8,"suggestions":"87"},{"ruleId":"88","severity":1,"message":"89","line":57,"column":9,"nodeType":"90","endLine":57,"endColumn":71},{"ruleId":"68","severity":1,"message":"91","line":1,"column":17,"nodeType":"70","messageId":"71","endLine":1,"endColumn":26},{"ruleId":"68","severity":1,"message":"92","line":1,"column":28,"nodeType":"70","messageId":"71","endLine":1,"endColumn":36},{"ruleId":"68","severity":1,"message":"93","line":2,"column":8,"nodeType":"70","messageId":"71","endLine":2,"endColumn":13},"no-unused-vars","'Component' is defined but never used.","Identifier","unusedVar","no-native-reassign",["94"],"no-negated-in-lhs",["95"],"'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.","React Hook useEffect has missing dependencies: 'Board' and 'board_id'. Either include them or remove the dependency array.","ArrayExpression",["96"],"jsx-a11y/alt-text","img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.","JSXOpeningElement","'useEffect' is defined but never used.","'useState' is defined but never used.","'axios' is defined but never used.","no-global-assign","no-unsafe-negation",{"desc":"97","fix":"98"},"Update the dependencies array to be: [Board, board_id]",{"range":"99","text":"100"},[1309,1311],"[Board, board_id]"]
\ No newline at end of file
import React, { Component } from "react";
import { Route } from "react-router-dom";
import { Route, Switch } from "react-router-dom";
import Home from "./components/Home";
import Login from "./components/Login";
import Signup from "./components/Signup";
......@@ -35,14 +35,24 @@ import WriteProfile from "./components/WriteProfile";
const App = () => {
return (
<div>
<Switch>
<Route path="/" component={Home} exact={true} />
<Route path="/login" component={Login} />
<Route path="/signup" component={Signup} />
<Route path="/profile" component={Profile} />
<Route path="/makeProfile" compenent={WriteProfile} exact={true} />
<Route path="/board" component={Board} />
<Route path="/writeBoard" component={WriteBoard} />
<Route path="/writeBoard" component={WriteBoard} exact={true} />
<Route path="/detailBoard/:board_id" component={DetailBoard} />
<Route path="/writeProfile" compenent={WriteProfile} />
<Route
render={({ location }) => (
<div>
<h2> 페이지는 존재하지않습니다.</h2>
<p>{location.pathname}</p>
</div>
)}
/>
</Switch>
</div>
);
};
......
......@@ -32,7 +32,7 @@ const Board = () => {
<Link to="/writeBoard">게시글 작성</Link>
</button>
<button>
<Link to="/writeProfile">프로필 작성</Link>
<Link to="/makeProfile">프로필 작성</Link>
</button>
<form action="http://localhost:3001/searchBoard" method="post">
<input type="text" name="searchKeyword"></input>
......
......@@ -2,57 +2,58 @@ import React, { useEffect, useState } from "react";
import axios from "axios";
const WriteProfile = () => {
const [Profile, setProfile] = useState({
profile_photo: "",
created_at: "",
self_intro: "",
user_id: "",
user_email: "",
location: "",
age: "",
});
useEffect(async () => {
async function fetchData() {
console.log("writeProfile axios get 호출");
let res = axios.get("http://localhost:3001/getProfileInfo");
console.log(res);
setProfile(res.data);
}
fetchData();
}, []);
return (
<form method="post" action="http://localhost:3001/writeProfile">
<input type="hidden" value={Profile.user_id} name="uid"></input>
<input type="hidden" value={Profile.user_email} name="uem"></input>
<input
type="file"
name="photo"
placeholder="프로필 사진"
value={Profile.profile_photo}
></input>
<input
type="text"
name="self_intro"
placeholder="간단한 자기소개 및 관심사"
value={Profile.self_intro}
></input>
<input
type="text"
name="age"
placeholder="나이"
value={Profile.age}
></input>
<input
type="text"
name="loc"
placeholder="사는 곳"
value={Profile.location}
></input>
<button type="submit">작성 완료</button>
</form>
);
// const [Profile, setProfile] = useState({
// profile_photo: "",
// created_at: "",
// self_intro: "",
// user_id: "",
// user_email: "",
// location: "",
// age: "",
// });
// useEffect(async () => {
// async function fetchData() {
// console.log("writeProfile axios get 호출");
// let res = await axios.get("http://localhost:3001/getProfileInfo");
// console.log(res);
// setProfile(res.data);
// }
// fetchData();
// }, []);
// return (
// <div>
// <form method="post" action="http://localhost:3001/writeProfile">
// <input type="hidden" value={Profile.user_id} name="uid"></input>
// <input type="hidden" value={Profile.user_email} name="uem"></input>
// <input
// type="file"
// name="photo"
// placeholder="프로필 사진"
// value={Profile.profile_photo}
// ></input>
// <input
// type="text"
// name="self_intro"
// placeholder="간단한 자기소개 및 관심사"
// value={Profile.self_intro}
// ></input>
// <input
// type="text"
// name="age"
// placeholder="나이"
// value={Profile.age}
// ></input>
// <input
// type="text"
// name="loc"
// placeholder="사는 곳"
// value={Profile.location}
// ></input>
// <button type="submit">작성 완료</button>
// </form>
// </div>
// );
return <h3>dfdsdsdsdf</h3>;
};
export default WriteProfile;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment