Files
baserow/web-frontend/modules/builder/mixins/domainForm.js
716d43a9a8 Nuxt 3 migration (#4342)
Update the nuxt3 version.

Co-authored-by: Jonathan Adeline <jonathan@baserow.io>
Co-authored-by: Bram Wiepjes <bramw@protonmail.com>
Co-authored-by: Cezary <cezary@baserow.io>
Co-authored-by: Tsering Paljor <tsering@baserow.io>
Co-authored-by: Przemyslaw Kukulski <przemyslaw+gh@baserow.io>
Co-authored-by: Bram <bram2w@users.noreply.github.com>
2026-01-22 10:27:19 +01:00

44 lines
816 B
JavaScript

import form from '@baserow/modules/core/mixins/form'
export default {
mixins: [form],
emits: ['error'],
props: {
domain: {
type: String,
required: true,
},
},
data() {
return {
serverErrors: {},
}
},
computed: {
hasServerErrors() {
return Object.values(this.serverErrors).some((value) => value !== null)
},
},
watch: {
hasServerErrors: {
handler(val) {
this.$emit('error', val)
},
},
},
methods: {
handleServerError(error) {
if (error.handler.code !== 'ERROR_REQUEST_BODY_VALIDATION') return false
this.serverErrors = Object.fromEntries(
Object.entries(error.handler.detail || {}).map(([key, value]) => [
key,
value[0],
])
)
return true
},
},
}