@ukhomeoffice/cop-react-form-renderer 1.0.0-alpha → 1.0.0-beta
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.
|
@@ -154,7 +154,12 @@ var FormRenderer = function FormRenderer(_ref) {
|
|
|
154
154
|
} // Now submit the data to the backend...
|
|
155
155
|
|
|
156
156
|
|
|
157
|
-
hooks.onSubmit(action.type, submissionData, function () {
|
|
157
|
+
hooks.onSubmit(action.type, submissionData, function (response) {
|
|
158
|
+
// The backend response may well contain data we need so apply it.
|
|
159
|
+
setData(function (prev) {
|
|
160
|
+
return _objectSpread(_objectSpread({}, prev), response);
|
|
161
|
+
});
|
|
162
|
+
|
|
158
163
|
var nextPageId = _helpers.default.getNextPageId(type, pages, pageId, action);
|
|
159
164
|
|
|
160
165
|
onPageChange(nextPageId);
|