hof 19.13.9 → 19.13.10

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.
@@ -82,13 +82,15 @@ module.exports = (key, opts) => {
82
82
  };
83
83
 
84
84
  // defaultFormatters on the base controller replace '--' with '-' on the process step.
85
- // This ensures having the correct number of hyphens,
86
- // so values do not jump from year to month when the page reloads.
85
+ // This ensures having the correct number of hyphens, so values do not jump from year to month.
86
+ // This should only be done on a partially completed date field otherwise the validation messages break.
87
87
  const postProcess = (req, res, next) => {
88
- req.form.values[key] = req.body[key];
88
+ const value = req.form.values[key];
89
+ if (value) {
90
+ req.form.values[key] = req.body[key];
91
+ }
89
92
  next();
90
93
  };
91
-
92
94
  // if date field is included in errorValues, extend
93
95
  // errorValues with the individual components
94
96
  const preGetErrors = (req, res, next) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hof",
3
3
  "description": "A bootstrap for HOF projects",
4
- "version": "19.13.9",
4
+ "version": "19.13.10",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
7
7
  "author": "HomeOffice",