feat: local sections in sub-events can use festival-level time slots
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,12 +13,16 @@ interface PaginatedResponse<T> {
|
||||
data: T[]
|
||||
}
|
||||
|
||||
export function useTimeSlotList(eventId: Ref<string>) {
|
||||
export function useTimeSlotList(eventId: Ref<string>, options?: { includeParent?: Ref<boolean> }) {
|
||||
const includeParent = options?.includeParent
|
||||
|
||||
return useQuery({
|
||||
queryKey: ['time-slots', eventId],
|
||||
queryKey: ['time-slots', eventId, includeParent],
|
||||
queryFn: async () => {
|
||||
const params = includeParent?.value ? { include_parent: 'true' } : {}
|
||||
const { data } = await apiClient.get<PaginatedResponse<TimeSlot>>(
|
||||
`/events/${eventId.value}/time-slots`,
|
||||
{ params },
|
||||
)
|
||||
|
||||
return data.data
|
||||
|
||||
Reference in New Issue
Block a user