15 lines
560 B
TypeScript
15 lines
560 B
TypeScript
import { NextRequest, NextResponse } from 'next/server';
|
|
import { getBookedAppointments } from '@/lib/firestore';
|
|
|
|
export async function GET(request: NextRequest) {
|
|
try {
|
|
// TODO: Get userId from auth token
|
|
const userId = 'test-user-id'; // Replace with actual auth
|
|
const appointments = await getBookedAppointments(userId);
|
|
return NextResponse.json({ appointments });
|
|
} catch (error) {
|
|
console.error('Error fetching appointments:', error);
|
|
return NextResponse.json({ error: 'Failed to fetch appointments' }, { status: 500 });
|
|
}
|
|
}
|