Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
eue
Commits
306703ad
Commit
306703ad
authored
Aug 07, 2021
by
KangMin An
Browse files
Update: 주석 해제
parent
94720bc6
Changes
1
Show whitespace changes
Inline
Side-by-side
client/src/components/ChartTemp.js
View file @
306703ad
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment