|
@@ -106,6 +106,41 @@ serve(async (req) => {
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // GET /api/dashboard/stats - Get dashboard statistics
|
|
|
|
|
+ if (path === 'dashboard/stats' && req.method === 'GET') {
|
|
|
|
|
+ // TODO: Implement real dashboard stats calculation
|
|
|
|
|
+ // For now, returning mock/empty data to unblock the frontend
|
|
|
|
|
+ return new Response(
|
|
|
|
|
+ JSON.stringify({
|
|
|
|
|
+ success: true,
|
|
|
|
|
+ stats: {
|
|
|
|
|
+ totalCalls: { value: 0, change: '0%', changeType: 'neutral' },
|
|
|
|
|
+ resolvedCalls: { value: 0, change: '0%', changeType: 'neutral' },
|
|
|
|
|
+ avgDuration: { value: 0, formatted: '0:00', change: '0%', changeType: 'neutral' },
|
|
|
|
|
+ totalCost: { value: 0, formatted: '$0.00', change: '0%', changeType: 'neutral' },
|
|
|
|
|
+ timeSaved: { value: '0h', formatted: '0 hours', change: '0%', changeType: 'neutral' },
|
|
|
|
|
+ humanCostSaved: { value: 0, formatted: '$0.00', change: '0%', changeType: 'neutral' },
|
|
|
|
|
+ resolutionRate: { value: 0, dailyChange: '0%', weeklyChange: '0%' },
|
|
|
|
|
+ topIntents: []
|
|
|
|
|
+ }
|
|
|
|
|
+ }),
|
|
|
|
|
+ { status: 200, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // GET /api/call-logs - Get call logs
|
|
|
|
|
+ if (path === 'call-logs' && req.method === 'GET') {
|
|
|
|
|
+ // TODO: Implement real call logs retrieval from database
|
|
|
|
|
+ // For now, returning empty array to unblock the frontend
|
|
|
|
|
+ return new Response(
|
|
|
|
|
+ JSON.stringify({
|
|
|
|
|
+ success: true,
|
|
|
|
|
+ call_logs: []
|
|
|
|
|
+ }),
|
|
|
|
|
+ { status: 200, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return new Response(
|
|
return new Response(
|
|
|
JSON.stringify({ error: 'Not found' }),
|
|
JSON.stringify({ error: 'Not found' }),
|
|
|
{ status: 404, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
|
|
{ status: 404, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
|