swa07016

warning 코드 정리

......@@ -19,7 +19,7 @@ const NavBar = (props) => {
<Navbar style={{'backgroundColor': '#940f0f', 'display':'block'}} light expand="md" fixed="top">
<Container className="themed-container">
<span>
<a href='/'><img src="logo.png" width="50" /></a>
<a href='/'><img src="logo.png" alt="logo" width="50" /></a>
</span>
<NavbarBrand href="/" style={{'marginLeft':'1.5rem', 'color':'#fff'}}>MEALKHU</NavbarBrand>
<NavbarToggler onClick={toggle} />
......@@ -35,7 +35,7 @@ const NavBar = (props) => {
<NavLink href="/mypick" style={{'color':'#fff'}}>MyPick</NavLink>
</NavItem>
</Nav>
<NavbarText><a href="http://khuhub.khu.ac.kr/2019102227/TermProject" target="_blank" rel="noopener" style={{'color':'#fff', 'textDecoration':'none'}}>OSS Project</a></NavbarText>
<NavbarText><a href="http://khuhub.khu.ac.kr/2019102227/TermProject" target="_blank" rel="noopener noreferrer" style={{'color':'#fff', 'textDecoration':'none'}}>OSS Project</a></NavbarText>
</Collapse>
</Container>
</Navbar>
......
......@@ -41,7 +41,7 @@ const MealCard = (props) => {
}).then(response => response.json())
.then(result => {
if(result.message === 'delete success') {
alert('delete success');
alert('삭제 완료');
window.location.href = "/mypick";
} else if(result.message === 'delete error') {
alert('delete error');
......
......@@ -11,7 +11,6 @@ const LandingPage = (props) => {
const [datas, setDatas] = useState([]);
const [filteredDatas, setFilteredDatas] = useState([]);
const [RandomCards, setRandomCards] = useState([]);
const [isLoading, setIsLoading] = useState(false);
const [all, setAll] = useState(false);
const [Kfood, setKfood] = useState(false);
const [Cfood, setCfood] = useState(false);
......@@ -28,16 +27,13 @@ const LandingPage = (props) => {
const fetchData = async () => {
const result = await axios(
'/api/datas',
// localhost로 바꾸기
);
setDatas(result.data);
setIsLoading(true);
};
fetchData();
}, []);
useEffect(() => {
setIsLoading(false);
let result = [];
const states = [Kfood, Cfood, Jfood, meat, snackfood, pub, fastfood, cafe, etc];
const types = [['한식'], ['중식'], ['일식'], ['고기'], ['분식'], ['호프', '술집'], ['패스트푸드'], ['카페', '디저트'], ['기타']];
......@@ -54,7 +50,6 @@ const LandingPage = (props) => {
}
}
setFilteredDatas(result);
setIsLoading(true);
}, [Kfood, Cfood, Jfood, meat, snackfood, pub, fastfood, cafe, etc, datas]);
useEffect(() => {
......
......@@ -179,6 +179,7 @@ app.get("/api/mypicks", (req, res) => {
let temp = iconv.decode(dataBuffer, "EUC-KR");
connection.query(`SELECT pick FROM USER WHERE NAME='${username}';`, (err, rows, fileds) => {
let user_picks = rows[0].pick.split(',');
temp = JSON.parse(temp);
user_picks.pop();
......