Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating address autocomplete endpoint #746

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {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`, () => {

Check warning on line 6 in src/formio/components/TextField.mocks.js

View check run for this annotation

Codecov / codecov/patch

src/formio/components/TextField.mocks.js#L6

Added line #L6 was not covered by tests
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);
});