Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Karakas
SWP_SS24_Wetterdaten_sammeln
Commits
06d9a846
Commit
06d9a846
authored
Jun 09, 2024
by
EnesKarakas
Browse files
fes
parent
a50ceffe
Changes
2
Hide whitespace changes
Inline
Side-by-side
frontend/src/components/weather/historicalWeatherData.js
View file @
06d9a846
...
...
@@ -316,9 +316,7 @@ const HistoricalWeatherData = (props) => {
let
filterHourlyString
=
filterHourlyArray
.
join
(
"
,
"
);
let
filterDailyString
=
filterDailyArray
.
join
(
"
,
"
);
const
apiUrl
=
`http://localhost:8080/historicalweather?latitude=
${
latitude_text
}
&longitude=
${
longitude_text
}
&start_date=
${
start_date
}
&end_date=
${
end_date
}
&filterHourly=
${
filterHourlyString
}
&filterDaily=
${
filterDailyString
}
&temperature_unit=
${
temp_units
}
&wind_speed_unit=
${
wind_units
}
&precipitation_unit=
${
prec_units
}
`
;
const
apiUrl
=
`http://localhost:8080/historicalweather?latitude=
${
latitude_text
}
&longitude=
${
longitude_text
}
&start_date=
${
start_date
}
&end_date=
${
end_date
}
&filterHourly=
${
filterHourlyString
}
&filterDaily=
${
filterDailyString
}
&temperature_unit=
${
temp_units
}
&wind_speed_unit=
${
wind_units
}
&precipitation_unit=
${
prec_units
}
`
;
fetch
(
apiUrl
)
.
then
((
response
)
=>
{
if
(
!
response
.
ok
)
{
...
...
frontend/src/components/weather/weatherForecastData.js
View file @
06d9a846
...
...
@@ -12,6 +12,7 @@ const WeatherForecastData = (props) => {
searchAPI
(
e
.
target
.
value
.
trim
());
}
};
return
(
<
div
className
=
"
home-container
"
>
<
div
>
...
...
@@ -325,6 +326,7 @@ const WeatherForecastData = (props) => {
<
/option
>
<
/select
>
<
/div
>
<
input
type
=
"
range
"
min
=
"
-5
"
max
=
"
5
"
step
=
"
1.0
"
value
=
"
0
"
/>
<
div
>
<
button
className
=
"
thq-button-filled
"
onClick
=
{
getData
}
>
Generate
...
...
@@ -346,8 +348,6 @@ const WeatherForecastData = (props) => {
readOnly
/>
<
/div
>
<
br
/>
<
br
/>
<
/div
>
<
/div
>
<
/div
>
...
...
@@ -574,8 +574,9 @@ const WeatherForecastData = (props) => {
let
filterString
=
filterArray
.
join
(
"
,
"
);
const
apiUrl
=
`http://localhost:8080/forcastweather?q=
${
latitude_text
}
,
${
longitude_text
}
&filter=
${
filterString
}
`
;
const
apiUrl
=
`http://localhost:8080/for
e
castweather?q=
${
latitude_text
}
,
${
longitude_text
}
&filter=
${
filterString
}
`
;
console
.
log
(
apiUrl
);
fetch
(
apiUrl
)
.
then
((
response
)
=>
{
if
(
!
response
.
ok
)
{
...
...
@@ -641,4 +642,5 @@ const ListItem = ({ name, country, region, lat, lon }) => {
<
/div
>
);
};
export
default
WeatherForecastData
;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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