Add detailed logging to API endpoints for debugging 500 errors

This commit is contained in:
Marco Gallegos
2026-01-18 08:49:16 -06:00
parent c0a9568e5c
commit 93366fc596
17 changed files with 2020 additions and 127 deletions

View File

@@ -0,0 +1,29 @@
import { NextRequest, NextResponse } from 'next/server';
import { cookies } from 'next/headers';
import { googleCalendar } from '@/lib/google-calendar';
/**
* @description Test Google Calendar connection endpoint
* @description Only accessible by admin/manager roles
*/
export async function GET(request: NextRequest) {
try {
// TODO: Add admin auth check using middleware or supabaseAdmin
// Temporarily open for testing
// Test connection
const result = await googleCalendar.testConnection();
return NextResponse.json({
success: true,
data: result,
timestamp: new Date().toISOString(),
});
} catch (error: any) {
console.error('Google Calendar test failed:', error);
return NextResponse.json(
{ success: false, error: 'Internal server error', details: error.message },
{ status: 500 }
);
}
}