Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | export const dynamic = 'force-dynamic'; /** * Admin Chat Conversations Stats API * GET /api/admin/support/chat/conversations/stats - Get chat queue statistics */ import { NextResponse } from 'next/server'; import { withAdmin, withErrorHandling, ApiSuccessResponse, ApiErrorResponse, } from '@/lib/api'; import { ChatService } from '@/services'; import { Session } from 'next-auth'; // ============================================================================ // HANDLERS // ============================================================================ /** * GET /api/admin/support/chat/conversations/stats * Get chat queue statistics for agents */ async function handleGet( _request: Request, _context: unknown, session: Session ): Promise<NextResponse<ApiSuccessResponse<unknown> | ApiErrorResponse>> { const agentId = session.user.id; const stats = await ChatService.getAgentQueueStats(agentId); return NextResponse.json({ success: true, data: stats, }); } // ============================================================================ // EXPORTS // ============================================================================ export const GET = withErrorHandling(withAdmin(handleGet)); |