improve timezone discovery

This commit is contained in:
Joyce
2026-01-28 14:53:12 -05:00
parent daa0afaa25
commit 880925f30d
23 changed files with 807 additions and 157 deletions

View File

@@ -5,6 +5,7 @@ export interface ParticipantAPI {
id: string;
name: string;
email: string;
timezone: string;
ics_url: string | null;
created_at: string;
updated_at: string;
@@ -13,6 +14,7 @@ export interface ParticipantAPI {
export interface TimeSlotAPI {
day: string;
hour: number;
start_time: string;
availability: 'full' | 'partial' | 'none';
availableParticipants: string[];
}
@@ -20,6 +22,12 @@ export interface TimeSlotAPI {
export interface CreateParticipantRequest {
name: string;
email: string;
timezone: string;
ics_url?: string;
}
export interface UpdateParticipantRequest {
timezone?: string;
ics_url?: string;
}
@@ -45,6 +53,15 @@ export async function createParticipant(data: CreateParticipantRequest): Promise
return handleResponse<ParticipantAPI>(response);
}
export async function updateParticipant(id: string, data: UpdateParticipantRequest): Promise<ParticipantAPI> {
const response = await fetch(`${API_URL}/api/participants/${id}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data),
});
return handleResponse<ParticipantAPI>(response);
}
export async function deleteParticipant(id: string): Promise<void> {
const response = await fetch(`${API_URL}/api/participants/${id}`, {
method: 'DELETE',