Commit 06d9a846 authored by EnesKarakas's avatar EnesKarakas
Browse files

fes

parent a50ceffe
...@@ -316,9 +316,7 @@ const HistoricalWeatherData = (props) => { ...@@ -316,9 +316,7 @@ const HistoricalWeatherData = (props) => {
let filterHourlyString = filterHourlyArray.join(","); let filterHourlyString = filterHourlyArray.join(",");
let filterDailyString = filterDailyArray.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} 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}`;
&wind_speed_unit=${wind_units}&precipitation_unit=${prec_units}`;
fetch(apiUrl) fetch(apiUrl)
.then((response) => { .then((response) => {
if (!response.ok) { if (!response.ok) {
......
...@@ -12,6 +12,7 @@ const WeatherForecastData = (props) => { ...@@ -12,6 +12,7 @@ const WeatherForecastData = (props) => {
searchAPI(e.target.value.trim()); searchAPI(e.target.value.trim());
} }
}; };
return ( return (
<div className="home-container"> <div className="home-container">
<div> <div>
...@@ -325,6 +326,7 @@ const WeatherForecastData = (props) => { ...@@ -325,6 +326,7 @@ const WeatherForecastData = (props) => {
</option> </option>
</select> </select>
</div> </div>
<input type="range" min="-5" max="5" step="1.0" value="0" />
<div> <div>
<button className="thq-button-filled" onClick={getData}> <button className="thq-button-filled" onClick={getData}>
Generate Generate
...@@ -346,8 +348,6 @@ const WeatherForecastData = (props) => { ...@@ -346,8 +348,6 @@ const WeatherForecastData = (props) => {
readOnly readOnly
/> />
</div> </div>
<br />
<br />
</div> </div>
</div> </div>
</div> </div>
...@@ -574,8 +574,9 @@ const WeatherForecastData = (props) => { ...@@ -574,8 +574,9 @@ const WeatherForecastData = (props) => {
let filterString = filterArray.join(","); let filterString = filterArray.join(",");
const apiUrl = `http://localhost:8080/forcastweather?q=${latitude_text},${longitude_text}&filter=${filterString}`; const apiUrl = `http://localhost:8080/forecastweather?q=${latitude_text},${longitude_text}&filter=${filterString}`;
console.log(apiUrl);
fetch(apiUrl) fetch(apiUrl)
.then((response) => { .then((response) => {
if (!response.ok) { if (!response.ok) {
...@@ -641,4 +642,5 @@ const ListItem = ({ name, country, region, lat, lon }) => { ...@@ -641,4 +642,5 @@ const ListItem = ({ name, country, region, lat, lon }) => {
</div> </div>
); );
}; };
export default WeatherForecastData; export default WeatherForecastData;
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