Skip to content

Commit

Permalink
Merge pull request #746 from open-formulieren/task/3283-changing-depr…
Browse files Browse the repository at this point in the history
…ecated-address-endpoint

Updating address autocomplete endpoint
  • Loading branch information
sergei-maertens authored Dec 2, 2024
2 parents 3fc0038 + be2eebf commit e57ff26
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/formio/components/TextField.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class TextField extends Formio.Components.components.textfield {
get setLocationData() {
if (!this._debouncedSetLocationData) {
this._debouncedSetLocationData = debounce((postcode, house_number, key) => {
get(`${this.options.baseUrl}location/get-street-name-and-city`, {postcode, house_number})
get(`${this.options.baseUrl}geo/address-autocomplete`, {postcode, house_number})
.then(result => {
if (result[key]) {
this.setValue(result[key]);
Expand Down
2 changes: 1 addition & 1 deletion src/formio/components/TextField.mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import {HttpResponse, http} from 'msw';
import {BASE_URL} from 'api-mocks';

export const mockAddressAutoCompleteGet = (street = 'Keizersgracht', city = 'Amsterdam') =>
http.get(`${BASE_URL}location/get-street-name-and-city`, () => {
http.get(`${BASE_URL}geo/address-autocomplete`, () => {
return HttpResponse.json({streetName: street, city});
});
2 changes: 1 addition & 1 deletion src/jstests/formio/components/textfield.mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import {HttpResponse, http} from 'msw';
import {BASE_URL} from 'api-mocks';

export const mockLocationGet = result =>
http.get(`${BASE_URL}location/get-street-name-and-city`, () => {
http.get(`${BASE_URL}geo/address-autocomplete`, () => {
return HttpResponse.json(result);
});

0 comments on commit e57ff26

Please sign in to comment.