fix: move BookingFlow window type to app.d.ts and fix authHeaders typing
Move __bookingFlowCountdownInterval from inline declare global in BookingFlow.svelte to global app.d.ts. Fix authHeaders type from {} to undefined to satisfy TypeScript.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -27,12 +27,6 @@
|
||||
import { onDestroy } from 'svelte';
|
||||
import { SvelteDate } from 'svelte/reactivity';
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
__bookingFlowCountdownInterval?: ReturnType<typeof setInterval> | null;
|
||||
}
|
||||
}
|
||||
|
||||
// Components
|
||||
import BookingActions from '$lib/components/booking/BookingActions.svelte';
|
||||
import BookingSummary from '$lib/components/booking/BookingSummary.svelte';
|
||||
@@ -688,7 +682,7 @@
|
||||
loadingAvailableHours = true;
|
||||
|
||||
try {
|
||||
const authHeaders = authStore.currentToken ? { Authorization: `Bearer ${authStore.currentToken}` } : {};
|
||||
const authHeaders: RequestInit['headers'] = authStore.currentToken ? { Authorization: `Bearer ${authStore.currentToken}` } : undefined;
|
||||
const [whRes, ahRes] = await Promise.all([
|
||||
fetch(`/api/scheduling/working-hours?start=${startStr}&end=${endStr}`, { headers: authHeaders }),
|
||||
fetch(`/api/scheduling/available-hours?start=${startStr}&end=${endStr}`, { headers: authHeaders })
|
||||
@@ -782,7 +776,7 @@
|
||||
const startStr = startOfMonth.toString();
|
||||
const endStr = endOfMonth.toString();
|
||||
|
||||
const authHeaders = authStore.currentToken ? { Authorization: `Bearer ${authStore.currentToken}` } : {};
|
||||
const authHeaders: RequestInit['headers'] = authStore.currentToken ? { Authorization: `Bearer ${authStore.currentToken}` } : undefined;
|
||||
|
||||
// Fetch working hours
|
||||
const workingHoursResponse = await fetch(
|
||||
|
||||
Reference in New Issue
Block a user