Skip to content

Commit

Permalink
Update locationSearch.js
Browse files Browse the repository at this point in the history
  • Loading branch information
garmartirosy authored May 29, 2024
1 parent d1e3206 commit bf3407b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions view/location/locationSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,18 @@ document.addEventListener('DOMContentLoaded', function () {
url = `https://seeclickfix.com/api/v2/issues?search[place_name]=${globalAddress}`;
}

if (results.length > 0) {
// Store latitude and longitude of the first item in localStorage
localStorage.setItem('latitude', results[0].lat);
localStorage.setItem('longitude', results[0].lng);
}


requestsDiv.innerHTML = "";

axios.get(url)
.then((data) => {
const results = data.data.issues;


if (results.length > 0) {
// Store latitude and longitude of the first item in localStorage
localStorage.setItem('latitude', results[0].lat);
localStorage.setItem('longitude', results[0].lng);
}
results.forEach(item => {
const introDiv = document.createElement('div');
introDiv.innerHTML = `
Expand Down

0 comments on commit bf3407b

Please sign in to comment.