fix(types): resolve 4 pre-existing vue-tsc errors

- EventMetricCards: type navigateTo's routeName as the literal union
  of the two routes it actually targets (events-id-persons,
  events-id-sections) so the typed router accepts it.
- CreateTimeSlotDialog: type the form ref explicitly so person_type
  is PersonType rather than being inferred as string.
- @layouts/types.ts: relax LayoutConfig.app.title from Lowercase<string>
  to string. The lowercase constraint was a compile-time namespacing
  convention in the Vuexy template with zero runtime effect;
  relaxing it lets the branded "Crewli" title satisfy the type.
This commit is contained in:
2026-04-16 22:45:44 +02:00
parent 4da74d2bd4
commit cffc34f627
3 changed files with 16 additions and 5 deletions

View File

@@ -4,7 +4,7 @@ import type { AppContentLayoutNav, ContentWidth, FooterType, HorizontalNavType,
export interface LayoutConfig {
app: {
title: Lowercase<string>
title: string
logo: VNode
contentWidth: typeof ContentWidth[keyof typeof ContentWidth]
contentLayoutNav: typeof AppContentLayoutNav[keyof typeof AppContentLayoutNav]

View File

@@ -13,7 +13,9 @@ const orgIdRef = computed(() => authStore.currentOrganisation?.id ?? '')
const eventIdRef = computed(() => props.eventId)
const { data: stats, isLoading, isError, refetch } = useEventStats(orgIdRef, eventIdRef)
function navigateTo(routeName: string) {
type EventChildRoute = 'events-id-persons' | 'events-id-sections'
function navigateTo(routeName: EventChildRoute) {
router.push({ name: routeName, params: { id: props.eventId } })
}

View File

@@ -3,10 +3,19 @@ import { VForm } from 'vuetify/components/VForm'
import { useCreateTimeSlot, useUpdateTimeSlot } from '@/composables/api/useTimeSlots'
import { useAuthStore } from '@/stores/useAuthStore'
import { requiredValidator } from '@core/utils/validators'
import type { TimeSlot } from '@/types/section'
import type { PersonType, TimeSlot } from '@/types/section'
import type { AxiosError } from 'axios'
import type { ApiErrorResponse } from '@/types/auth'
interface TimeSlotFormState {
name: string
person_type: PersonType
date: string
start_time: string
end_time: string
duration_hours: number | null
}
const props = defineProps<{
eventId: string
timeSlot?: TimeSlot | null
@@ -21,13 +30,13 @@ const eventIdRef = computed(() => props.eventId)
const isEditing = computed(() => !!props.timeSlot)
const form = ref({
const form = ref<TimeSlotFormState>({
name: '',
person_type: 'VOLUNTEER',
date: '',
start_time: '',
end_time: '',
duration_hours: null as number | null,
duration_hours: null,
})
const errors = ref<Record<string, string>>({})