Skip to content

Commit

Permalink
resolve bad user inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Silent-Watcher committed Mar 25, 2023
1 parent e426215 commit 23aa2da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ function addTemplate() {
}

function addApiResponseData(data) {
$.querySelector('#name').innerHTML = data.name;
$.querySelector('#name').innerHTML = data.name || 'not found';
$.querySelector('#temperature').innerHTML = `${convertFahrenheitToCelsius(
data.main.temp
)}℃`;
)}℃` ;
$.querySelector('#date').innerHTML = moment().format('dddd MMMM Do YYYY');
$.querySelector('#state').innerHTML = data.weather.at(0).main;
$.querySelector('#state').innerHTML = data.weather.at(0).main ;
$.querySelector('#low_temp').innerHTML = `${convertFahrenheitToCelsius(
data.main.temp_min
)}℃`;
Expand Down
12 changes: 6 additions & 6 deletions src/pug/template.pug
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
template#main_template
p#name Northampton, GB
p#date Thursday 10 January 2020
h1#temperature 15℃
h3#state Sunny
p#name not found
p#date not found
h1#temperature ..
h3#state ¯\(°_o)/¯
p.mt-3
span#low_temp 13℃
span#low_temp ..
| /
span#high_temp 16℃
span#high_temp ..

0 comments on commit 23aa2da

Please sign in to comment.