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:
Vendored
+1
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user