mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-11 03:40:20 +00:00
Add states api endpoint to support existing code on the customer details page when user changes country
This commit is contained in:
@@ -4,8 +4,7 @@ var update_state = function(region) {
|
||||
var state_select = $('span#' + region + 'state select.select2');
|
||||
var state_input = $('span#' + region + 'state input.state_name');
|
||||
|
||||
$.get(Spree.routes.states_search + "?country_id=" + country, function(data) {
|
||||
var states = data["states"]
|
||||
$.get(Spree.routes.states_search + "?country_id=" + country, function(states) {
|
||||
if (states.length > 0) {
|
||||
state_select.html('');
|
||||
var states_with_blank = [{name: '', id: ''}].concat(states);
|
||||
|
||||
Reference in New Issue
Block a user