Skip to content

Commit

Permalink
Fix globe location finder
Browse files Browse the repository at this point in the history
  • Loading branch information
forsbergplustwo committed Sep 21, 2023
1 parent 4f46e75 commit e354902
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/javascript/controllers/globe_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,10 @@ export default class extends Controller {

async setUserLocation() {
// Using https://ip-api.com/json/
const response = await get("https://ip-api.com/json/?fields=countryCode");
const response = await get("https://api.country.is");
if (response.ok) {
const locationData = await response.json;
this.myLocationValue = locationData.countryCode;
this.myLocationValue = locationData.country;
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/create_partner_api_credentials.rake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ task create_partner_api_credentials: :environment do
User.find_each do |user|
if user.partner_api_access_token.present? && user.partner_api_organization_id.present? && !user.partner_api_errors&.include?("Unauthorized")
if user.partner_api_credential.blank?
user.create_partner_api_credential!(
user.create_partner_api_credential(
organization_id: user.partner_api_organization_id,
access_token: user.partner_api_access_token
)
Expand Down

0 comments on commit e354902

Please sign in to comment.