From be2eebfffe3f5f39bcc52733477902cb6273f137 Mon Sep 17 00:00:00 2001 From: robinvandermolen Date: Mon, 2 Dec 2024 15:01:30 +0100 Subject: [PATCH] :alien: [open-formulieren/open-forms#3283] changing the endpoint for setLocationData Open Forms will no longer support /location/get-street-name-and-city. /geo/address-autocomplete is the endpoint that should be used --- src/formio/components/TextField.js | 2 +- src/formio/components/TextField.mocks.js | 2 +- src/jstests/formio/components/textfield.mocks.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/formio/components/TextField.js b/src/formio/components/TextField.js index 6e510c2db..5590ef5e2 100644 --- a/src/formio/components/TextField.js +++ b/src/formio/components/TextField.js @@ -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]); diff --git a/src/formio/components/TextField.mocks.js b/src/formio/components/TextField.mocks.js index e290b1285..f09d89862 100644 --- a/src/formio/components/TextField.mocks.js +++ b/src/formio/components/TextField.mocks.js @@ -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}); }); diff --git a/src/jstests/formio/components/textfield.mocks.js b/src/jstests/formio/components/textfield.mocks.js index c009c105e..5e69cfb10 100644 --- a/src/jstests/formio/components/textfield.mocks.js +++ b/src/jstests/formio/components/textfield.mocks.js @@ -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); });