Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Commit

Permalink
Use updated validation API
Browse files Browse the repository at this point in the history
Fixes #2614
  • Loading branch information
nicksellen committed Dec 11, 2022
1 parent c856b39 commit bae3033
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/authuser/components/Settings/ProfileEdit.vue
Expand Up @@ -138,9 +138,9 @@ export default {
displayNameError () {
if (this.v$.edit.displayName.$error) {
const m = this.v$.edit.displayName
if (!m.required) return this.$t('VALIDATION.REQUIRED')
if (!m.minLength) return this.$t('VALIDATION.MINLENGTH', { min: 2 })
if (!m.maxLength) return this.$t('VALIDATION.MAXLENGTH', { max: 81 })
if (m.required.$invalid) return this.$t('VALIDATION.REQUIRED')
if (m.minLength.$invalid) return this.$t('VALIDATION.MINLENGTH', { min: 2 })
if (m.maxLength.$invalid) return this.$t('VALIDATION.MAXLENGTH', { max: 81 })
}
return this.firstError('displayName')
},
Expand Down
10 changes: 5 additions & 5 deletions src/authuser/components/Signup.vue
Expand Up @@ -129,9 +129,9 @@ export default {
displayNameError () {
if (this.v$.user.displayName.$error) {
const m = this.v$.user.displayName
if (!m.required) return this.$t('VALIDATION.REQUIRED')
if (!m.minLength) return this.$t('VALIDATION.MINLENGTH', { min: 2 })
if (!m.maxLength) return this.$t('VALIDATION.MAXLENGTH', { max: 81 })
if (m.required.$invalid) return this.$t('VALIDATION.REQUIRED')
if (m.minLength.$invalid) return this.$t('VALIDATION.MINLENGTH', { min: 2 })
if (m.maxLength.$invalid) return this.$t('VALIDATION.MAXLENGTH', { max: 81 })
}
return this.firstError('displayName')
},
Expand All @@ -141,8 +141,8 @@ export default {
usernameError () {
if (this.v$.user.username.$error) {
const m = this.v$.user.username
if (!m.required) return this.$t('VALIDATION.REQUIRED')
if (!m.valid) return this.$t('VALIDATION.VALID_USERNAME')
if (m.required.$invalid) return this.$t('VALIDATION.REQUIRED')
if (m.valid.$invalid) return this.$t('VALIDATION.VALID_USERNAME')
}
const error = this.firstError('username')
if (error === 'username_invalid') return this.$t('VALIDATION.VALID_USERNAME')
Expand Down
4 changes: 2 additions & 2 deletions src/group/components/ActivityTypeForm.vue
Expand Up @@ -403,8 +403,8 @@ export default {
nameError () {
if (this.v$.edit.name.$error) {
const m = this.v$.edit.name
if (!m.required) return this.$t('VALIDATION.REQUIRED')
if (!m.isUnique) return this.$t('VALIDATION.UNIQUE')
if (m.required.$invalid) return this.$t('VALIDATION.REQUIRED')
if (m.isUnique.$invalid) return this.$t('VALIDATION.UNIQUE')
}
return this.firstError('name')
},
Expand Down
4 changes: 2 additions & 2 deletions src/group/components/PlaceTypeForm.vue
Expand Up @@ -265,8 +265,8 @@ export default {
nameError () {
if (this.v$.edit.name.$error) {
const m = this.v$.edit.name
if (!m.required) return this.$t('VALIDATION.REQUIRED')
if (!m.isUnique) return this.$t('VALIDATION.UNIQUE')
if (m.required.$invalid) return this.$t('VALIDATION.REQUIRED')
if (m.isUnique.$invalid) return this.$t('VALIDATION.UNIQUE')
}
return this.firstError('name')
},
Expand Down

0 comments on commit bae3033

Please sign in to comment.