Skip to content

Commit

Permalink
Merge branch 'main' into 147a6-rich-text-input
Browse files Browse the repository at this point in the history
  • Loading branch information
chiragchhatrala authored Nov 27, 2024
2 parents a3ee265 + 3d09f32 commit 0019ed2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
2 changes: 2 additions & 0 deletions client/components/forms/PhoneInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ export default {
watch: {
inputVal: {
handler(val) {
if (!this.selectedCountryCode) return
if (val && val.startsWith("0")) {
val = val.substring(1)
}
Expand Down
4 changes: 2 additions & 2 deletions client/components/open/forms/components/FormEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export default {
})
.catch((error) => {
if (error?.response?.status === 422) {
this.validationErrorResponse = error.response.data
this.validationErrorResponse = error.data
this.showValidationErrors()
} else {
useAlert().error(
Expand Down Expand Up @@ -306,7 +306,7 @@ export default {
})
.catch((error) => {
if (error?.response?.status === 422) {
this.validationErrorResponse = error.response
this.validationErrorResponse = error.data
this.showValidationErrors()
} else {
useAlert().error(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
@close="$emit('close')"
>
<div class="-mx-5">
<h2 class="text-red-400 text-2xl font-bold mb-4 px-4">
<h2 class="text-red-600 text-2xl font-bold mb-4 px-4">
Error saving your form
</h2>

<div
v-if="form.errors"
v-if="validationErrorResponse"
class="p-4 border-b border-t"
>
<p
v-if="form.errors.message"
v-text="form.errors.message"
v-if="validationErrorResponse.message"
v-text="validationErrorResponse.message"
/>
<ul class="list-disc list-inside">
<li
v-for="(err, key) in form.errors.errors"
v-for="(err, key) in validationErrorResponse.errors"
:key="key"
>
{{ Array.isArray(err) ? err[0] : err }}
Expand All @@ -41,17 +41,11 @@

<script>
export default {
name: "FormErrorModal",
components: {},
name: 'FormErrorModal',
props: {
show: { type: Boolean, required: true },
form: { type: Object, required: false },
validationErrorResponse: { type: Object, required: false },
},
emits: ['close'],
data: () => ({}),
computed: {},
methods: {},
}
</script>

0 comments on commit 0019ed2

Please sign in to comment.