@kaspernj/api-maker 1.0.266 → 1.0.267

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.
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  ]
17
17
  },
18
18
  "name": "@kaspernj/api-maker",
19
- "version": "1.0.266",
19
+ "version": "1.0.267",
20
20
  "type": "module",
21
21
  "description": "",
22
22
  "main": "index.js",
@@ -716,10 +716,16 @@ export default class BaseModel {
716
716
  try {
717
717
  return await CommandsPool.addCommand(args, commandArgs)
718
718
  } catch (error) {
719
- if (formOrDataObject?.nodeName == "FORM") {
720
- BaseModel.parseValidationErrors({error, options: {form: formOrDataObject}})
719
+ let form
720
+
721
+ if (commandArgs.form) {
722
+ form = commandArgs.form
723
+ } else if (formOrDataObject?.nodeName == "FORM") {
724
+ form = formOrDataObject
721
725
  }
722
726
 
727
+ if (form) BaseModel.parseValidationErrors({error, options: {form}})
728
+
723
729
  throw error
724
730
  }
725
731
  }