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:
@@ -3,7 +3,7 @@ import { VForm } from 'vuetify/components/VForm'
|
||||
import EventTabsNav from '@/components/events/EventTabsNav.vue'
|
||||
import { useUpdateEvent, useUploadEventImage } from '@/composables/api/useEvents'
|
||||
import { useAuthStore } from '@/stores/useAuthStore'
|
||||
import type { EventItem } from '@/types/event'
|
||||
import type { EventItem, UpdateEventPayload } from '@/types/event'
|
||||
|
||||
definePage({
|
||||
meta: {
|
||||
@@ -55,7 +55,7 @@ function onFileSelected(files: File[], type: 'banner' | 'logo') {
|
||||
function onClearImage(event: EventItem, type: 'banner' | 'logo') {
|
||||
const field = type === 'banner' ? 'registration_banner_url' : 'registration_logo_url'
|
||||
|
||||
updateEvent({ [field]: null } as any)
|
||||
updateEvent({ [field]: null } as UpdateEventPayload)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
} from '@/composables/api/useRegistrationFormFields'
|
||||
import { useAuthStore } from '@/stores/useAuthStore'
|
||||
import { useNotificationStore } from '@/stores/useNotificationStore'
|
||||
import type { RegistrationFormField } from '@/types/registration-form-field'
|
||||
import type { RegistrationFormField, RegistrationFormFieldCreateDTO } from '@/types/registration-form-field'
|
||||
import type { EventItem } from '@/types/event'
|
||||
|
||||
definePage({
|
||||
@@ -97,7 +97,7 @@ function openEditDialog(field: RegistrationFormField) {
|
||||
isFieldDialogOpen.value = true
|
||||
}
|
||||
|
||||
function onSaveField(payload: Record<string, any>) {
|
||||
function onSaveField(payload: Partial<RegistrationFormFieldCreateDTO>) {
|
||||
if (editingField.value) {
|
||||
updateField(
|
||||
{ id: editingField.value.id, ...payload },
|
||||
@@ -111,7 +111,7 @@ function onSaveField(payload: Record<string, any>) {
|
||||
)
|
||||
}
|
||||
else {
|
||||
createField(payload as any, {
|
||||
createField(payload as RegistrationFormFieldCreateDTO, {
|
||||
onSuccess: () => {
|
||||
isFieldDialogOpen.value = false
|
||||
notificationStore.show(`${payload.label} aangemaakt`, 'success')
|
||||
|
||||
Reference in New Issue
Block a user