fix: eliminate all TypeScript any usage across Vue components
Replace 24 `err: any` error handler types with proper `AxiosError<ApiErrorResponse>` typing. Fix additional `as any` casts and `Record<string, any>` patterns in registration field components, event settings, and portal layout. Create shared `ApiErrorResponse` type for portal app. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,8 @@ import { useUpdateMemberRole } from '@/composables/api/useMembers'
|
||||
import { useAuthStore } from '@/stores/useAuthStore'
|
||||
import { requiredValidator } from '@core/utils/validators'
|
||||
import type { Member, OrganisationRole } from '@/types/member'
|
||||
import type { AxiosError } from 'axios'
|
||||
import type { ApiErrorResponse } from '@/types/auth'
|
||||
|
||||
const props = defineProps<{
|
||||
orgId: string
|
||||
@@ -51,8 +53,8 @@ function onSubmit() {
|
||||
modelValue.value = false
|
||||
showSuccess.value = true
|
||||
},
|
||||
onError: (err: any) => {
|
||||
const data = err.response?.data
|
||||
onError: (err: Error) => {
|
||||
const data = (err as AxiosError<ApiErrorResponse>).response?.data
|
||||
if (data?.errors) {
|
||||
errors.value = { role: data.errors.role?.[0] ?? '' }
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ import { VForm } from 'vuetify/components/VForm'
|
||||
import { useInviteMember } from '@/composables/api/useMembers'
|
||||
import { emailValidator, requiredValidator } from '@core/utils/validators'
|
||||
import type { OrganisationRole } from '@/types/member'
|
||||
import type { AxiosError } from 'axios'
|
||||
import type { ApiErrorResponse } from '@/types/auth'
|
||||
|
||||
const props = defineProps<{
|
||||
orgId: string
|
||||
@@ -50,8 +52,8 @@ function onSubmit() {
|
||||
modelValue.value = false
|
||||
showSuccess.value = true
|
||||
},
|
||||
onError: (err: any) => {
|
||||
const data = err.response?.data
|
||||
onError: (err: Error) => {
|
||||
const data = (err as AxiosError<ApiErrorResponse>).response?.data
|
||||
if (data?.errors) {
|
||||
errors.value = {
|
||||
email: data.errors.email?.[0] ?? '',
|
||||
|
||||
Reference in New Issue
Block a user