diff --git a/client/.eslintcache b/client/.eslintcache index acf1c5873d7f8a6c21579f1f10fa481e2049fcc6..ddb754c75629b5b0d49f235e0f385abb07cb7827 100644 --- a/client/.eslintcache +++ b/client/.eslintcache @@ -1 +1 @@ -[{"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\index.js":"1","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\App.js":"2","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\reportWebVitals.js":"3","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Home.js":"4","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Login.js":"5","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Signup.js":"6","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Menu.js":"7","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Header.js":"8","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Info.js":"9","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Join.js":"10","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Match.js":"11","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\JList.js":"12","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\MList.js":"13","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\request.js":"14","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\InList.js":"15"},{"size":500,"mtime":499162500000,"results":"16","hashOfConfig":"17"},{"size":986,"mtime":1607731725247,"results":"18","hashOfConfig":"17"},{"size":362,"mtime":499162500000,"results":"19","hashOfConfig":"17"},{"size":306,"mtime":1607357448211,"results":"20","hashOfConfig":"17"},{"size":3248,"mtime":1607769232317,"results":"21","hashOfConfig":"17"},{"size":5080,"mtime":1607719645143,"results":"22","hashOfConfig":"17"},{"size":1049,"mtime":1607402199570,"results":"23","hashOfConfig":"17"},{"size":2996,"mtime":1607768749803,"results":"24","hashOfConfig":"17"},{"size":3511,"mtime":1607794268173,"results":"25","hashOfConfig":"17"},{"size":3412,"mtime":1607793389828,"results":"26","hashOfConfig":"17"},{"size":3375,"mtime":1607793400265,"results":"27","hashOfConfig":"17"},{"size":3577,"mtime":1607772117404,"results":"28","hashOfConfig":"17"},{"size":3580,"mtime":1607772145606,"results":"29","hashOfConfig":"17"},{"size":2305,"mtime":1607728004747,"results":"30","hashOfConfig":"17"},{"size":3620,"mtime":1607793823210,"results":"31","hashOfConfig":"17"},{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},"acqgsi",{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"37","messages":"38","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"43","messages":"44","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"45","messages":"46","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"47","messages":"48","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"49","messages":"50","errorCount":0,"warningCount":5,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"51","messages":"52","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"53","messages":"54","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"55","messages":"56","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"57","usedDeprecatedRules":"34"},{"filePath":"58","messages":"59","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"60","usedDeprecatedRules":"34"},{"filePath":"61","messages":"62","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"63","usedDeprecatedRules":"34"},{"filePath":"64","messages":"65","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\index.js",[],["66","67"],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\App.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\reportWebVitals.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Home.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Login.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Signup.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Menu.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Header.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Info.js",["68","69","70","71","72"],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Join.js",["73"],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Match.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\JList.js",["74","75","76"],"import React from 'react'\r\nimport request from '../request'\r\nimport { withRouter, Redirect } from 'react-router-dom'\r\n\r\nclass JList extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n Lists: [],\r\n click: false,\r\n content : \"\",\r\n title: \"\"\r\n }\r\n }\r\n showDes = e => {\r\n this.setState({\r\n click: true\r\n })\r\n this.state.Lists.map(list => {\r\n if(list.title === e.target.innerText) {\r\n this.setState({\r\n content: list.description,\r\n title: list.title\r\n })\r\n }\r\n })\r\n }\r\n Goback = e => {\r\n this.setState({\r\n click: false\r\n });\r\n this.props.history.push('/join');\r\n }\r\n componentDidMount() { \r\n request.getJoinList().then().then(data => {\r\n this.setState({\r\n Lists: data\r\n })\r\n });\r\n }\r\n render() {\r\n const format = [];\r\n const number = []\r\n if(this.state.Lists.length > 0){\r\n this.state.Lists.map(list => {\r\n number.push(1);\r\n format.push(<tr></tr>)\r\n format.push(<td>{number.length}</td>)\r\n format.push(<td onClick={this.showDes}>{list.title}</td>)\r\n });\r\n }\r\n \r\n if(this.state.click === true) {\r\n return(\r\n <div>\r\n <div className=\"form_container\">\r\n <div className=\"form_title_div\">\r\n <p className=\"form_title_p\">게시물</p>\r\n </div>\r\n <div>\r\n <div>\r\n <p className=\"form_item_name\">title</p>\r\n </div>\r\n <div>\r\n <input type=\"text\" className=\"form_input\" value={this.state.title}/>\r\n </div>\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_username\" className=\"form_text_alert\"></div>\r\n </div>\r\n </div>\r\n <div>\r\n <div>\r\n <p className=\"form_item_name\">Content</p>\r\n </div>\r\n <div>\r\n <textarea className=\"form_input\" value={this.state.content}/>\r\n </div>\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_password\" className=\"form_text_alert\"></div>\r\n </div>\r\n </div>\r\n <div>\r\n <button type=\"button\" className=\"form_submit_button\" onClick={this.Goback}>Back</button>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n ) \r\n } else {\r\n return(\r\n <div className=\"showList\">\r\n <table>\r\n <tr>\r\n <th>Index</th>\r\n <th>Title</th>\r\n </tr>\r\n {format}\r\n </table>\r\n </div> \r\n ) \r\n } \r\n }\r\n}\r\n\r\nexport default withRouter(JList)","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\MList.js",["77","78"],"import React from 'react'\r\nimport request from '../request'\r\nimport { withRouter } from 'react-router-dom'\r\n\r\nclass MList extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n Lists: [],\r\n click: false,\r\n content : \"\",\r\n title: \"\"\r\n }\r\n }\r\n showDes = e => {\r\n this.setState({\r\n click: true\r\n })\r\n this.state.Lists.map(list => {\r\n if(list.title === e.target.innerText) {\r\n this.setState({\r\n content: list.description,\r\n title: list.title\r\n })\r\n }\r\n })\r\n }\r\n Goback = e => {\r\n this.setState({\r\n click: false\r\n });\r\n this.props.history.push('/match');\r\n }\r\n componentDidMount() { \r\n \r\n request.getMatchList().then().then(data => {\r\n this.setState({\r\n Lists: data\r\n })\r\n });\r\n \r\n }\r\n render() {\r\n const format = [];\r\n const number = []\r\n if(this.state.Lists.length > 0) {\r\n this.state.Lists.map(list => {\r\n number.push(1);\r\n format.push(<tr></tr>)\r\n format.push(<td>{number.length}</td>)\r\n format.push(<td onClick={this.showDes}>{list.title}</td>)\r\n });\r\n }\r\n if(this.state.click === true) {\r\n return(\r\n <div>\r\n <div className=\"form_container\">\r\n <div className=\"form_title_div\">\r\n <p className=\"form_title_p\">게시물</p>\r\n </div>\r\n <div>\r\n <div>\r\n <p className=\"form_item_name\">title</p>\r\n </div>\r\n <div>\r\n <input type=\"text\" className=\"form_input\" value={this.state.title}/>\r\n </div>\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_username\" className=\"form_text_alert\"></div>\r\n </div>\r\n </div>\r\n <div>\r\n <div>\r\n <p className=\"form_item_name\">Content</p>\r\n </div>\r\n <div>\r\n <textarea className=\"form_input\" value={this.state.content}/>\r\n </div>\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_password\" className=\"form_text_alert\"></div>\r\n </div>\r\n </div>\r\n <div>\r\n <button type=\"button\" className=\"form_submit_button\" onClick={this.Goback}>Back</button>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n ) \r\n } else {\r\n return(\r\n <div className=\"showList\">\r\n <table>\r\n <tr>\r\n <th>Index</th>\r\n <th>Title</th>\r\n </tr>\r\n {format}\r\n </table>\r\n </div> \r\n ) \r\n } \r\n }\r\n}\r\n\r\nexport default withRouter(MList)","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\request.js",["79"],"import axios from 'axios';\r\n\r\nconst API_DEFAULT = \"http://localhost:3001/\";\r\nconst instance = axios.create({ baseURL: API_DEFAULT });\r\n\r\nexport async function getUser() {\r\n const result = await instance.get('/');\r\n console.log(result)\r\n return result.data\r\n}\r\n\r\nexport async function dropUser() {\r\n const result = await instance.get('/logout');\r\n return result.data\r\n}\r\n\r\n// export async function searchUser(email) {\r\n// const result = await instance.get('/login' + email);\r\n// return result.data\r\n// }\r\n\r\nexport async function putUser({username, email, password}) {\r\n const result = await instance.post('/routes/save', {\r\n username: username,\r\n email: email, \r\n password: password \r\n });\r\n console.log(result);\r\n return result.data\r\n}\r\n\r\nexport async function checkUser({email, password}) {\r\n const result = await instance.post('/routes/login', {\r\n email: email, \r\n password: password \r\n });\r\n console.log(result);\r\n return result.data\r\n}\r\n\r\nexport async function joinList({title, description}) {\r\n const result = await instance.post('/routes/join', {\r\n title: title,\r\n description: description\r\n });\r\n return result.data\r\n}\r\n\r\nexport async function matchList({title, description}) {\r\n const result = await instance.post('/routes/match', {\r\n title: title,\r\n description: description\r\n });\r\n return result.data\r\n}\r\n\r\nexport async function infoList({name, time, location}) {\r\n const result = await instance.post('/routes/info', {\r\n name: name,\r\n time: time,\r\n location: location\r\n });\r\n console.log(result.data)\r\n return result.data\r\n}\r\n\r\nexport async function getJoinList() {\r\n const result = await instance.get('/routes/join/return');\r\n return result.data;\r\n}\r\n\r\nexport async function getMatchList() {\r\n const result = await instance.get('/routes/match/return');\r\n return result.data;\r\n}\r\n\r\nexport async function getInfoList() {\r\n const result = await instance.get('/routes/info/return');\r\n return result.data;\r\n}\r\n\r\nexport default {\r\n getUser,\r\n dropUser,\r\n putUser,\r\n checkUser,\r\n // searchUser,\r\n joinList,\r\n matchList,\r\n getJoinList,\r\n getMatchList,\r\n infoList,\r\n getInfoList\r\n}\r\n\r\n\r\n\r\n\r\n","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\InList.js",[],{"ruleId":"80","replacedBy":"81"},{"ruleId":"82","replacedBy":"83"},{"ruleId":"84","severity":1,"message":"85","line":4,"column":10,"nodeType":"86","messageId":"87","endLine":4,"endColumn":23},{"ruleId":"84","severity":1,"message":"88","line":4,"column":37,"nodeType":"86","messageId":"87","endLine":4,"endColumn":43},{"ruleId":"84","severity":1,"message":"89","line":4,"column":45,"nodeType":"86","messageId":"87","endLine":4,"endColumn":50},{"ruleId":"84","severity":1,"message":"90","line":4,"column":52,"nodeType":"86","messageId":"87","endLine":4,"endColumn":56},{"ruleId":"91","severity":1,"message":"92","line":85,"column":39,"nodeType":"93","messageId":"94","endLine":85,"endColumn":41},{"ruleId":"84","severity":1,"message":"95","line":4,"column":22,"nodeType":"86","messageId":"87","endLine":4,"endColumn":30},{"ruleId":"84","severity":1,"message":"95","line":3,"column":22,"nodeType":"86","messageId":"87","endLine":3,"endColumn":30},{"ruleId":"91","severity":1,"message":"92","line":19,"column":35,"nodeType":"93","messageId":"94","endLine":19,"endColumn":37},{"ruleId":"91","severity":1,"message":"92","line":45,"column":39,"nodeType":"93","messageId":"94","endLine":45,"endColumn":41},{"ruleId":"91","severity":1,"message":"92","line":19,"column":35,"nodeType":"93","messageId":"94","endLine":19,"endColumn":37},{"ruleId":"91","severity":1,"message":"92","line":47,"column":39,"nodeType":"93","messageId":"94","endLine":47,"endColumn":41},{"ruleId":"96","severity":1,"message":"97","line":82,"column":1,"nodeType":"98","endLine":94,"endColumn":2},"no-native-reassign",["99"],"no-negated-in-lhs",["100"],"no-unused-vars","'BrowserRouter' is defined but never used.","Identifier","unusedVar","'Switch' is defined but never used.","'Route' is defined but never used.","'Link' is defined but never used.","array-callback-return","Array.prototype.map() expects a return value from arrow function.","ArrowFunctionExpression","expectedInside","'Redirect' is defined but never used.","import/no-anonymous-default-export","Assign object to a variable before exporting as module default","ExportDefaultDeclaration","no-global-assign","no-unsafe-negation"] \ No newline at end of file +[{"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\index.js":"1","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\App.js":"2","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\reportWebVitals.js":"3","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Home.js":"4","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Login.js":"5","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Signup.js":"6","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Menu.js":"7","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Header.js":"8","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Info.js":"9","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Join.js":"10","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Match.js":"11","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\JList.js":"12","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\MList.js":"13","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\request.js":"14","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\InList.js":"15"},{"size":500,"mtime":499162500000,"results":"16","hashOfConfig":"17"},{"size":986,"mtime":1607731725247,"results":"18","hashOfConfig":"17"},{"size":362,"mtime":499162500000,"results":"19","hashOfConfig":"17"},{"size":306,"mtime":1607357448211,"results":"20","hashOfConfig":"17"},{"size":3248,"mtime":1607769232317,"results":"21","hashOfConfig":"17"},{"size":5080,"mtime":1607719645143,"results":"22","hashOfConfig":"17"},{"size":1049,"mtime":1607402199570,"results":"23","hashOfConfig":"17"},{"size":2996,"mtime":1607768749803,"results":"24","hashOfConfig":"17"},{"size":3511,"mtime":1607794268173,"results":"25","hashOfConfig":"17"},{"size":3294,"mtime":1607795949257,"results":"26","hashOfConfig":"17"},{"size":3275,"mtime":1607796749429,"results":"27","hashOfConfig":"17"},{"size":3637,"mtime":1607796915927,"results":"28","hashOfConfig":"17"},{"size":3621,"mtime":1607796975146,"results":"29","hashOfConfig":"17"},{"size":2305,"mtime":1607728004747,"results":"30","hashOfConfig":"17"},{"size":3482,"mtime":1607795723392,"results":"31","hashOfConfig":"17"},{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},"acqgsi",{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"37","messages":"38","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"43","messages":"44","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"45","messages":"46","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"47","messages":"48","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"49","messages":"50","errorCount":0,"warningCount":5,"fixableErrorCount":0,"fixableWarningCount":0,"source":"51","usedDeprecatedRules":"34"},{"filePath":"52","messages":"53","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"54","messages":"55","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"56","messages":"57","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"58","messages":"59","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"60","messages":"61","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"62","usedDeprecatedRules":"34"},{"filePath":"63","messages":"64","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\index.js",[],["65","66"],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\App.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\reportWebVitals.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Home.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Login.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Signup.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Menu.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Header.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Info.js",["67","68","69","70","71"],"import React from 'react'\r\nimport InList from './InList'\r\nimport request from '../request'\r\nimport { BrowserRouter, withRouter, Switch, Route, Link } from 'react-router-dom'\r\n\r\nclass Info extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n click: false,\r\n update: false,\r\n location: \"\",\r\n Lists: []\r\n }\r\n this.returnsearch = this.returnsearch.bind(this)\r\n }\r\n detect = event => {\r\n this.setState({\r\n location: event.target.value\r\n })\r\n }\r\n showList = event => {\r\n event.preventDefault();\r\n request.getInfoList().then().then(datas => {\r\n if(datas.length > 0) {\r\n const result = datas.filter(data => data.location === this.state.location)\r\n this.setState({\r\n Lists: result,\r\n click: true\r\n })\r\n }\r\n });\r\n }\r\n goBack = event => {\r\n event.preventDefault();\r\n this.setState({\r\n click: false\r\n })\r\n }\r\n returnsearch() {\r\n this.setState({\r\n update: false\r\n });\r\n }\r\n onUpate = event => {\r\n event.preventDefault();\r\n this.setState({\r\n update: true\r\n })\r\n }\r\n render() {\r\n if(this.state.update === true) {\r\n return(\r\n <InList return={this.returnsearch}></InList>\r\n )\r\n }\r\n if(this.state.click === false) {\r\n return(\r\n <div className=\"form_container\">\r\n <div className=\"searchLocation\">\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_username\" className=\"form_text_alert\"></div>\r\n </div>\r\n <div>\r\n <p className=\"form_item_name\">search</p>\r\n </div>\r\n <div>\r\n <input type=\"text\" className=\"form_input\" onChange={this.detect}></input>\r\n </div>\r\n \r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_username\" className=\"form_text_alert\"></div>\r\n </div>\r\n <button type=\"button\" onClick={this.showList} className=\"form_submit_button\">Search</button>\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_username\" className=\"form_text_alert\"></div>\r\n </div>\r\n <button type=\"button\" className=\"form_submit_button\" onClick={this.onUpate.bind(this)}>New</button>\r\n \r\n </div>\r\n </div>\r\n )\r\n } else {\r\n const filter_list = [];\r\n this.state.Lists.map(list => {\r\n filter_list.push(<li>{list.time} {list.name}</li>)\r\n })\r\n return(\r\n <div className=\"form_container\">\r\n <p>경기장 리스트</p>\r\n <ul>\r\n {filter_list}\r\n </ul> \r\n <button type=\"button\" className=\"form_submit_button\" onClick={this.goBack}>Back</button>\r\n </div> \r\n )\r\n }\r\n }\r\n}\r\n\r\nexport default withRouter(Info)","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Join.js",["72"],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Match.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\JList.js",["73","74","75"],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\MList.js",["76","77"],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\request.js",["78"],"import axios from 'axios';\r\n\r\nconst API_DEFAULT = \"http://localhost:3001/\";\r\nconst instance = axios.create({ baseURL: API_DEFAULT });\r\n\r\nexport async function getUser() {\r\n const result = await instance.get('/');\r\n console.log(result)\r\n return result.data\r\n}\r\n\r\nexport async function dropUser() {\r\n const result = await instance.get('/logout');\r\n return result.data\r\n}\r\n\r\n// export async function searchUser(email) {\r\n// const result = await instance.get('/login' + email);\r\n// return result.data\r\n// }\r\n\r\nexport async function putUser({username, email, password}) {\r\n const result = await instance.post('/routes/save', {\r\n username: username,\r\n email: email, \r\n password: password \r\n });\r\n console.log(result);\r\n return result.data\r\n}\r\n\r\nexport async function checkUser({email, password}) {\r\n const result = await instance.post('/routes/login', {\r\n email: email, \r\n password: password \r\n });\r\n console.log(result);\r\n return result.data\r\n}\r\n\r\nexport async function joinList({title, description}) {\r\n const result = await instance.post('/routes/join', {\r\n title: title,\r\n description: description\r\n });\r\n return result.data\r\n}\r\n\r\nexport async function matchList({title, description}) {\r\n const result = await instance.post('/routes/match', {\r\n title: title,\r\n description: description\r\n });\r\n return result.data\r\n}\r\n\r\nexport async function infoList({name, time, location}) {\r\n const result = await instance.post('/routes/info', {\r\n name: name,\r\n time: time,\r\n location: location\r\n });\r\n console.log(result.data)\r\n return result.data\r\n}\r\n\r\nexport async function getJoinList() {\r\n const result = await instance.get('/routes/join/return');\r\n return result.data;\r\n}\r\n\r\nexport async function getMatchList() {\r\n const result = await instance.get('/routes/match/return');\r\n return result.data;\r\n}\r\n\r\nexport async function getInfoList() {\r\n const result = await instance.get('/routes/info/return');\r\n return result.data;\r\n}\r\n\r\nexport default {\r\n getUser,\r\n dropUser,\r\n putUser,\r\n checkUser,\r\n // searchUser,\r\n joinList,\r\n matchList,\r\n getJoinList,\r\n getMatchList,\r\n infoList,\r\n getInfoList\r\n}\r\n\r\n\r\n\r\n\r\n","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\InList.js",[],{"ruleId":"79","replacedBy":"80"},{"ruleId":"81","replacedBy":"82"},{"ruleId":"83","severity":1,"message":"84","line":4,"column":10,"nodeType":"85","messageId":"86","endLine":4,"endColumn":23},{"ruleId":"83","severity":1,"message":"87","line":4,"column":37,"nodeType":"85","messageId":"86","endLine":4,"endColumn":43},{"ruleId":"83","severity":1,"message":"88","line":4,"column":45,"nodeType":"85","messageId":"86","endLine":4,"endColumn":50},{"ruleId":"83","severity":1,"message":"89","line":4,"column":52,"nodeType":"85","messageId":"86","endLine":4,"endColumn":56},{"ruleId":"90","severity":1,"message":"91","line":85,"column":39,"nodeType":"92","messageId":"93","endLine":85,"endColumn":41},{"ruleId":"83","severity":1,"message":"94","line":4,"column":22,"nodeType":"85","messageId":"86","endLine":4,"endColumn":30},{"ruleId":"83","severity":1,"message":"94","line":3,"column":22,"nodeType":"85","messageId":"86","endLine":3,"endColumn":30},{"ruleId":"90","severity":1,"message":"91","line":19,"column":35,"nodeType":"92","messageId":"93","endLine":19,"endColumn":37},{"ruleId":"90","severity":1,"message":"91","line":48,"column":39,"nodeType":"92","messageId":"93","endLine":48,"endColumn":41},{"ruleId":"90","severity":1,"message":"91","line":19,"column":35,"nodeType":"92","messageId":"93","endLine":19,"endColumn":37},{"ruleId":"90","severity":1,"message":"91","line":48,"column":39,"nodeType":"92","messageId":"93","endLine":48,"endColumn":41},{"ruleId":"95","severity":1,"message":"96","line":82,"column":1,"nodeType":"97","endLine":94,"endColumn":2},"no-native-reassign",["98"],"no-negated-in-lhs",["99"],"no-unused-vars","'BrowserRouter' is defined but never used.","Identifier","unusedVar","'Switch' is defined but never used.","'Route' is defined but never used.","'Link' is defined but never used.","array-callback-return","Array.prototype.map() expects a return value from arrow function.","ArrowFunctionExpression","expectedInside","'Redirect' is defined but never used.","import/no-anonymous-default-export","Assign object to a variable before exporting as module default","ExportDefaultDeclaration","no-global-assign","no-unsafe-negation"] \ No newline at end of file diff --git a/client/src/components/InList.js b/client/src/components/InList.js index 88b965238740cd792d724d82da4a68ac12762b4e..aa51c0012e000bd5cf5aee04c8d84400a293428e 100644 --- a/client/src/components/InList.js +++ b/client/src/components/InList.js @@ -38,13 +38,8 @@ class InList extends react.Component { request.infoList(data).then(result => { console.log(result); - this.setState({ - name: "", - time: "", - location: "" - }); }); - this.props.history.push('/info'); + this.props.return(); } Cancel = event => { event.preventDefault(); diff --git a/client/src/components/JList.js b/client/src/components/JList.js index 05030374b2a03f2f6dc255744c09c442b9f4f5fd..c5aa4434b7565b828b4666a8357b93d7aafbb718 100644 --- a/client/src/components/JList.js +++ b/client/src/components/JList.js @@ -31,6 +31,9 @@ class JList extends React.Component { }); this.props.history.push('/join'); } + shouldComponentUpdate() { + return true; + } componentDidMount() { request.getJoinList().then().then(data => { this.setState({ diff --git a/client/src/components/Join.js b/client/src/components/Join.js index 4e155d71efda399039f760fe42a3bb10c5294dac..9c1401a7c74820c6db36d169761c0f74cfb916ac 100644 --- a/client/src/components/Join.js +++ b/client/src/components/Join.js @@ -44,10 +44,6 @@ class Join extends React.Component { }); request.joinList(data).then(result => { - // this.setState({ - // title: "", - // description: "" - // }) this.props.history.push('/join'); }); } diff --git a/client/src/components/MList.js b/client/src/components/MList.js index a14e70b7ab7055352e28f7769db66d6ca8b01890..65605f9d9da302d069f67bc54058292093631020 100644 --- a/client/src/components/MList.js +++ b/client/src/components/MList.js @@ -31,14 +31,15 @@ class MList extends React.Component { }); this.props.history.push('/match'); } + shouldComponentUpdate() { + return true + } componentDidMount() { - request.getMatchList().then().then(data => { this.setState({ Lists: data }) }); - } render() { const format = []; diff --git a/client/src/components/Match.js b/client/src/components/Match.js index 75a118e4de59966a57bccb9846abc971304f37f4..1227b739913023d7c1198b636db6e922fb626da8 100644 --- a/client/src/components/Match.js +++ b/client/src/components/Match.js @@ -44,20 +44,15 @@ class Match extends React.Component { }); request.matchList(data).then(result => { - // this.setState({ - // title: "", - // description: "" - // }) - this.props.history.push('/match') + // this.props.history.push('/match') }); - } render() { if(this.state.click === false){ return( <div className="Group"> <button type="button" onClick={this.Makefile} className="Groupbut">new</button> - <MList></MList> + <MList check={this.state.click}></MList> </div> ) } else {