Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
janani2285 committed Aug 24, 2020
1 parent bd148b3 commit 2d3ad7c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
17 changes: 2 additions & 15 deletions client/src/components/Map/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,9 @@ export class MapContainer extends Component {
this.state.markerLocation.lng
).then(
(response) => {
console.log(response)
// const address = response.results[0].formatted_address;

const country = response.results[response.results.length-1].formatted_address;
console.log(country)
/* let addrArr = address.split(",");
let country = addrArr[addrArr.length - 1];
console.log("country",country)
if(country.trim() === "USA"){
console.log("Inside USA")
country = "United States"
}
if(country.trim() === "UK"){
console.log("Inside UK")
console.log("country",country)
country = "United Kingdom"
} */

if (
country.toLowerCase().trim() ===
this.props.country.toLowerCase().trim()
Expand Down
1 change: 0 additions & 1 deletion client/src/pages/Results/ResultsFacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ function ResultsFacts({ country }) {
// API call to get the facts about a given country
function getFacts() {
API.getCountryFacts(country).then((res) => {
console.log(res);
setFacts(res.data);
});
}
Expand Down
1 change: 0 additions & 1 deletion routes/results.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ const resultDataToUpdate = (data, req) => {
const objKey = Object.keys(obj);
//checking for key match irrespective of case
if (objKey[0].toLowerCase() === continent[0].toLowerCase()) {
console.log("continent present");
//Both the objects uses same key with diffrent cases, so refering the objects with respective key
obj[objKey] = req.body.results[continent];
isContnentPresent = true;
Expand Down

0 comments on commit 2d3ad7c

Please sign in to comment.