Open justinkook opened 5 years ago
class Geocode {
constructor(locationIndexInput) {
this.location = locationIndexInput;
// how do i handle the queryURL
}
const queryURL = (location) => 'api/geocode/' + location;
$.get( `api/geocode/${this.location}`)
.then(function (data) {
let formattedAddress = data.results[0].formatted_address;
let addressComponents = data.results[0].address_components;
callAddressCityIndex(addressComponents[0].short_name, formattedAddress)
})
.catch(function (err) {
console.log(err);
})
}
Are you okay with the class like this?
Yes! That looks correctly formatted / syntax. I can assign the issue to you if you are willing.
Assign it to me!! I will send in the PR in some hours.
I will need to initialize the class everywhere geocode()
will be called.
Sure, this issue has been assigned to @Oluwasetemi
Geocode function inside results.js needs to be refactored into classes with constructors for each unique location input as properties.