inertia-bootstrap-forms 1.0.40 → 1.0.42

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.
@@ -3047,7 +3047,7 @@ function Cu(t, e, i, n, r, s) {
3047
3047
  }
3048
3048
  const Su = /* @__PURE__ */ P(wu, [["render", Cu]]), Iu = N({
3049
3049
  components: { Alert: Os },
3050
- emits: ["submit", "reset", "onStart", "onFinish", "onSuccess", "change"],
3050
+ emits: ["submit", "reset", "onStart", "onFinish", "onSuccess", "onError", "change"],
3051
3051
  props: {
3052
3052
  url: {
3053
3053
  type: String,
@@ -3117,6 +3117,7 @@ const Su = /* @__PURE__ */ P(wu, [["render", Cu]]), Iu = N({
3117
3117
  async submit(t) {
3118
3118
  const e = this.modelValue;
3119
3119
  this.submitHandler ? await this.submitHandler(t) : (this.$emit("submit", t), await this.form.transform(function(i) {
3120
+ delete i.hasMessage, delete i.successMessage;
3120
3121
  let n = JSON.stringify({
3121
3122
  ...e,
3122
3123
  ...i
@@ -3128,12 +3129,13 @@ const Su = /* @__PURE__ */ P(wu, [["render", Cu]]), Iu = N({
3128
3129
  }).submit(this.method.toString(), this.url, {
3129
3130
  only: this.only,
3130
3131
  onStart: () => {
3131
- this.form.hasMessage = !1, this.form.successMessage = null, this.$emit("onStart"), this.form.clearErrors();
3132
+ this.form.hasMessage && (this.form.hasMessage = !1), this.form.successMessage && (this.form.hasMessage = null), this.$emit("onStart"), this.form.clearErrors();
3132
3133
  },
3133
3134
  onFinish: (i) => {
3134
3135
  this.$emit("onFinish", i);
3135
3136
  },
3136
3137
  onError: (i) => {
3138
+ this.$emit("onError", i);
3137
3139
  },
3138
3140
  onSuccess: (i) => {
3139
3141
  var n, r;