diff --git a/frontend/src/components/Camera/Camera.jsx b/frontend/src/components/Camera/Camera.jsx index 729f990..ed4fa34 100644 --- a/frontend/src/components/Camera/Camera.jsx +++ b/frontend/src/components/Camera/Camera.jsx @@ -37,13 +37,13 @@ export default function Camera() { .then((res) => { setEngFoodName(res.data) }).catch((err) => { - console.log(err) + }) setStatus(status+1); } } const handleYes = useCallback ((name) => { - console.log(name) + axios.get(`${process.env.REACT_APP_API_URL}/food/check?name=${name}`) .then((res) => { if (res.data.checkFlag === -1) { @@ -56,9 +56,9 @@ export default function Camera() { setStatus(0); navigate(`/ingredient/${res.data.id}`); } - console.log(res); + }).catch((err) => { - console.log(err) + }) }, [navigate]); @@ -93,7 +93,7 @@ export default function Camera() { }); handleStream(stream); } catch (err) { - console.log(err); + } }; } @@ -116,7 +116,7 @@ export default function Camera() { const context = canvas.getContext('2d'); context.drawImage(video, 0, 0, canvas.width, canvas.height); const dataUrl = canvas.toDataURL('image/png') - // console.log(dataUrl) + imageMaker(dataUrl); } }, []); @@ -153,7 +153,7 @@ export default function Camera() { .then((res) => { setEngFoodName(res.data) }).catch((err) => { - console.log(err) + }) setStatus(1); } diff --git a/frontend/src/components/Cart/Cart.jsx b/frontend/src/components/Cart/Cart.jsx index 940bd29..fbdc49f 100644 --- a/frontend/src/components/Cart/Cart.jsx +++ b/frontend/src/components/Cart/Cart.jsx @@ -33,7 +33,7 @@ export default function Cart() { .then((res) => { setCartItems(res.data) }).catch((err) => { - console.log(err) + }) // fetchCartItems(); @@ -41,9 +41,9 @@ export default function Cart() { // Check if the SDK is initialized if (Kakao.isInitialized()) { - console.log('Kakao SDK initialized.'); + } else { - console.error('Failed to initialize Kakao SDK.'); + } }, []); @@ -90,7 +90,7 @@ export default function Cart() { return response.data.data.url; } catch (error) { - console.error('Error uploading image to server:', error); + return null; } } @@ -104,7 +104,7 @@ export default function Cart() { // Upload the captured image to the Spring server const imageUrl = await uploadImageToImgbb(imageBlob); - console.log(imageUrl) + if (imageUrl) { Kakao.Link.sendDefault({ diff --git a/frontend/src/components/Cart/CartUtils.js b/frontend/src/components/Cart/CartUtils.js index 46df48b..f668ae6 100644 --- a/frontend/src/components/Cart/CartUtils.js +++ b/frontend/src/components/Cart/CartUtils.js @@ -10,9 +10,9 @@ export const toggleExpandUtil = (prevExpanded, ingredient) => ({ }; export const selectItemUtil = (prevSelectedItems, item, index) => { - console.log(prevSelectedItems) + if (prevSelectedItems[index].some((selectedItem) => selectedItem.ingredientName === item.ingredientName)) { - console.log('Item already added.'); + return prevSelectedItems; } const newSelectedItems = [...prevSelectedItems]; diff --git a/frontend/src/components/Categories/Category.jsx b/frontend/src/components/Categories/Category.jsx index 8eb54a1..fa3fabc 100644 --- a/frontend/src/components/Categories/Category.jsx +++ b/frontend/src/components/Categories/Category.jsx @@ -23,18 +23,18 @@ export default function Category({ categoryList, isChosen, setIsChosen, setPart, }); setPart(ingreAxios.data) } catch(error) { - console.error('Error cheapIngre data: ', error); + } } catch (error) { - console.error('Error cheap data: ', error); + } } else if (chosen === 'Vegetable' || chosen === 'Meat' || chosen === 'Popular') { try { const ingreAxios = await axios.get(`${process.env.REACT_APP_API_URL}/ingredient/${chosen}`, {params}); setPart(ingreAxios.data) } catch (error) { - console.error('Error VegiMeatPop data: ', error); + } } } diff --git a/frontend/src/components/Dish.jsx b/frontend/src/components/Dish.jsx index c23d880..0286cbe 100644 --- a/frontend/src/components/Dish.jsx +++ b/frontend/src/components/Dish.jsx @@ -72,7 +72,7 @@ function useRecipeAPI() { setOriginData(response.data); }) .catch(() => { - console.log('There are no nutrient data.'); + }); } }, [data]); diff --git a/frontend/src/components/Ingredient.jsx b/frontend/src/components/Ingredient.jsx index 28f0580..e769ad5 100644 --- a/frontend/src/components/Ingredient.jsx +++ b/frontend/src/components/Ingredient.jsx @@ -22,11 +22,11 @@ function useIngredientPrice() { useEffect(() => { axios.get(`${process.env.REACT_APP_API_URL}/deal/detail`, { params }) .then(function (response) { - console.log(response.data) + setData(response.data); }) .catch(function (err) { - console.log(err); + }); }, []); return data; @@ -46,7 +46,7 @@ function useRelatedFoodAPI(cardData) { setData(response.data.slice(0, 3)); }) .catch(function (err) { - console.log(err); + }); } }, [cardData]); @@ -81,7 +81,7 @@ function useNutrition() { setData(nutrientData); }) .catch(() => { - console.log('There is no nutrient data'); + }); }, []); return data; @@ -107,7 +107,7 @@ const useCardData = () => { setData(response.data); }) .catch(function (err) { - console.log(err); + }); }, []); return data; diff --git a/frontend/src/components/Main.js b/frontend/src/components/Main.js index 2166827..a9b0743 100644 --- a/frontend/src/components/Main.js +++ b/frontend/src/components/Main.js @@ -50,7 +50,7 @@ function Main() { const dishAxios = await axios.get(`${process.env.REACT_APP_API_URL}/recipe/Popular`, {params}); setDish(dishAxios.data) const ingreAxios = await axios.get(`${process.env.REACT_APP_API_URL}/ingredient/Popular`, {params}); - console.log(ingreAxios.data) + setIngredients(ingreAxios.data) setIngreName(ingreAxios.data[0].name) const priceChangeAxios = await axios.get(`${process.env.REACT_APP_API_URL}/deal/change`, {params}); @@ -68,11 +68,11 @@ function Main() { setIngreDish(ingreDishAxios.data.slice(0, 4)) } catch (error) { - console.error('Error fetching data: ', error); + } } catch (error) { - console.error('Error fetching data: ', error); + } }; const groupDataBySmall = (data) => { diff --git a/frontend/src/components/acoounts/SignUp.jsx b/frontend/src/components/acoounts/SignUp.jsx index 37133c7..a6d754f 100644 --- a/frontend/src/components/acoounts/SignUp.jsx +++ b/frontend/src/components/acoounts/SignUp.jsx @@ -72,17 +72,17 @@ export default function SignUp() { if (response.status === 201) { // 회원가입 성공 시 할 일 - console.log('회원가입 성공', response.data); + navigate('/login'); } else { // 회원가입 실패 시 할 일 - console.log('회원가입 실패', response.data); + } } catch (error) { - console.error('회원가입 오류 : ', error); + } - // console.log('회원가입 정보: ', { email, password, name, gender }) + } return (