fix: move BookingFlow window type to app.d.ts and fix authHeaders typing
CI / Go vulnerabilities (push) Successful in 34s
CI / Frontend lint & types (push) Failing after 1m11s
CI / Tests (push) Successful in 2m4s
CI / Race detector (push) Failing after 4m8s

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:
2026-07-05 11:55:45 +01:00
co-authored by Sisyphus
parent 69ae3e1f99
commit e642b0fa3e
2 changed files with 3 additions and 8 deletions
+1
View File
@@ -13,6 +13,7 @@ declare global {
__walkInCountdownInterval?: ReturnType<typeof setInterval>; __walkInCountdownInterval?: ReturnType<typeof setInterval>;
__walkInModalCountdownInterval?: ReturnType<typeof setInterval>; __walkInModalCountdownInterval?: ReturnType<typeof setInterval>;
__bookingCreateCountdownInterval?: ReturnType<typeof setInterval>; __bookingCreateCountdownInterval?: ReturnType<typeof setInterval>;
__bookingFlowCountdownInterval?: ReturnType<typeof setInterval> | null;
} }
} }
@@ -27,12 +27,6 @@
import { onDestroy } from 'svelte'; import { onDestroy } from 'svelte';
import { SvelteDate } from 'svelte/reactivity'; import { SvelteDate } from 'svelte/reactivity';
declare global {
interface Window {
__bookingFlowCountdownInterval?: ReturnType<typeof setInterval> | null;
}
}
// Components // Components
import BookingActions from '$lib/components/booking/BookingActions.svelte'; import BookingActions from '$lib/components/booking/BookingActions.svelte';
import BookingSummary from '$lib/components/booking/BookingSummary.svelte'; import BookingSummary from '$lib/components/booking/BookingSummary.svelte';
@@ -688,7 +682,7 @@
loadingAvailableHours = true; loadingAvailableHours = true;
try { 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([ const [whRes, ahRes] = await Promise.all([
fetch(`/api/scheduling/working-hours?start=${startStr}&end=${endStr}`, { headers: authHeaders }), fetch(`/api/scheduling/working-hours?start=${startStr}&end=${endStr}`, { headers: authHeaders }),
fetch(`/api/scheduling/available-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 startStr = startOfMonth.toString();
const endStr = endOfMonth.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 // Fetch working hours
const workingHoursResponse = await fetch( const workingHoursResponse = await fetch(