hof 21.2.0-postcode-lookup-beta.2 → 21.2.0-postcode-lookup-beta.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -279,7 +279,7 @@ module.exports = config => {
|
|
279
279
|
// Clear the value stored in the addresses radio button group
|
280
280
|
req.sessionModel.set(`${addressFieldNamePrefix}-select`, '');
|
281
281
|
// Replace punctuation in postcode and call OS Places API to return list of addresses
|
282
|
-
const enteredPostcode = req.
|
282
|
+
const enteredPostcode = req.form.values[`${addressFieldNamePrefix}-postcode`]?.replace(/[^\w]+/g, "").replace(/^(.*)(\d)/, "$1 $2");
|
283
283
|
|
284
284
|
await PostcodeLookup(enteredPostcode, apiURL, apiKey)
|
285
285
|
.then(function (response) {
|