Pass headers when server fetches the schedule

Fix the inital server side load of the schedule not including crew only
items due to headers not being passed from the client to server side
request made to fetch the schedule.
This commit is contained in:
Hornwitser 2025-03-10 20:59:22 +01:00
parent 5256f3fcf8
commit bb306ee938

View file

@ -5,9 +5,10 @@ let sourceRefs = 0;
let sourceSessionId: number | undefined = undefined;
export const useSchedule = () => {
const { data: session } = useAccountSession();
const requestFetch = useRequestFetch();
const asyncData = useAsyncData<Schedule>(
'schedule',
() => $fetch("/api/schedule"),
() => requestFetch("/api/schedule"),
{ default: () => ({ events: [], locations: [] }) },
)
const { data: schedule } = asyncData;