Commit 306703ad authored by KangMin An's avatar KangMin An
Browse files

Update: 주석 해제

parent 94720bc6
......@@ -9,25 +9,24 @@ import { routesClient } from "./../routesClient";
function ChartTemp() {
const [temp, setTemp] = useState([]);
// useEffect(() => {
// callUserInfo().then((res) => {
// const outs = axios.get(routesClient.outsideLoc + res['loc_code'])
// return outs
// .then((res) => {
// const outWeather = res.data.contents.weather_out
// console.log(res.data.contents.weather_out)
// let i = 0;
// // setTemp(res.data.contents.weather_out[0].temp)
// const tempArray = []
// for (i; i < 3; i++) {
// console.log(i)
// console.log(outWeather[i])
// tempArray.push(outWeather[i].temp)
// }
// setTemp(tempArray)
// })
// })
// }, [])
useEffect(() => {
callUserInfo().then((res) => {
const outs = axios.get(routesClient.outsideLoc + res["loc_code"]);
return outs.then((res) => {
const outWeather = res.data.contents.weather_out;
console.log(res.data.contents.weather_out);
let i = 0;
// setTemp(res.data.contents.weather_out[0].temp)
const tempArray = [];
for (i; i < 3; i++) {
console.log(i);
console.log(outWeather[i]);
tempArray.push(outWeather[i].temp);
}
setTemp(tempArray);
});
});
}, []);
console.log(temp);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment