@gov-cy/govcy-express-services 1.0.0-alpha.1 → 1.0.0-alpha.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.
@@ -27,7 +27,8 @@ export async function tempSaveIfConfigured(store, service, siteId) {
27
27
  const inputData = dataLayer.getSiteInputData(store, siteId) || {};
28
28
  const tempPayload = {
29
29
  // mirror final submission format: send stringified JSON
30
- submission_data: JSON.stringify(inputData)
30
+ // submission_data: JSON.stringify(inputData),
31
+ submissionData: JSON.stringify(inputData)
31
32
  };
32
33
 
33
34
  if (!url || !clientKey) {
@@ -263,6 +263,9 @@ export function validateFormElements(elements, formData, pageUrl) {
263
263
  formData[`${field.params.name}_day`]]
264
264
  .filter(Boolean) // Remove empty values
265
265
  .join("-") // Join remaining parts
266
+ // unneeded handle of `Attachment` at the end
267
+ // : (field.element === "fileInput") // Handle fileInput
268
+ // ? formData[`${field.params.name}Attachment`] || ""
266
269
  : formData[field.params.name] || ""; // Get submitted value
267
270
 
268
271
  //Autocheck: check for "checkboxes", "radios", "select" if `fieldValue` is one of the `field.params.items
@@ -310,6 +313,10 @@ export function validateFormElements(elements, formData, pageUrl) {
310
313
  formData[`${conditionalElement.params.name}_day`]]
311
314
  .filter(Boolean) // Remove empty values
312
315
  .join("-") // Join remaining parts
316
+ : (conditionalElement.element === "fileInput") // Handle fileInput
317
+ // unneeded handle of `Attachment` at the end
318
+ // ? formData[`${conditionalElement.params.name}Attachment`] || ""
319
+ ? formData[`${conditionalElement.params.name}`] || ""
313
320
  : formData[conditionalElement.params.name] || ""; // Get submitted value
314
321
 
315
322
  //Autocheck: check for "checkboxes", "radios", "select" if `fieldValue` is one of the `field.params.items`