Skip to content

Commit

Permalink
Don't try to make a call to the countries API when there's no Country…
Browse files Browse the repository at this point in the history
… ID present (#82)
  • Loading branch information
damianlegawiec authored Dec 19, 2021
1 parent 043be00 commit 2a3fc07
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/assets/javascripts/spree/backend/address_states.es6
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ function updateAddressState(region, successCallback) {
const stateSelect = $('#' + region + 'state select')
const stateInput = $('#' + region + 'state input.state_name')

if (!countryId) { return }

fetch(Spree.routes.countries_api_v2 + '/' + countryId + '?include=states', {
headers: Spree.apiV2Authentication()
}).then((response) => {
Expand Down

0 comments on commit 2a3fc07

Please sign in to comment.