hof 21.2.0-postcode-lookup-beta.2 → 21.2.0-postcode-lookup-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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.sessionModel.get(`${addressFieldNamePrefix}-postcode`)?.replace(/[^\w]+/g, "").replace(/^(.*)(\d)/, "$1 $2");
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) {
@@ -180,7 +180,7 @@ module.exports = Validators = {
180
180
 
181
181
  postcodeValidation(value) {
182
182
  // eslint-disable-next-line max-len
183
- return Validators.regex(value, /^(([GIRgir] ?[ ]*0[ ]*[Aa]{2}[ ]*)|((([A-Za-z][ ]*[0-9]{1,2}[ ]*)|(([A-Za-z][ ]*[A-Ha-hJ-Yj-y][ ]*[0-9][ ]*[0-9]?)[ ]*|(([A-Za-z][ ]*[0-9][ ]*[A-Za-z][ ]*)|([A-Za-z][ ]*[A-Ha-hJ-Yj-y][ ]*[0-9]?[ ]*[A-Za-z][ ]*))))[^\w]+?[ ]*[0-9][ ]*[A-Za-z][ ]*[A-Za-z][ ]*))$/);
183
+ return Validators.regex(value, /^(([GIRgir] ?[ ]*0[ ]*[Aa]{2}[ ]*)|((([A-Za-z][ ]*[0-9]{1,2}[ ]*)|(([A-Za-z][ ]*[A-Ha-hJ-Yj-y][ ]*[0-9][ ]*[0-9]?)[ ]*|(([A-Za-z][ ]*[0-9][ ]*[A-Za-z][ ]*)|([A-Za-z][ ]*[A-Ha-hJ-Yj-y][ ]*[0-9]?[ ]*[A-Za-z][ ]*))))[^\w]*?[ ]*[0-9][ ]*[A-Za-z][ ]*[A-Za-z][ ]*))$/);
184
184
  }
185
185
 
186
186
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hof",
3
3
  "description": "A bootstrap for HOF projects",
4
- "version": "21.2.0-postcode-lookup-beta.2",
4
+ "version": "21.2.0-postcode-lookup-beta.4",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
7
7
  "author": "HomeOffice",