Spaces:
Paused
Paused
dushyantsingh0 commited on
Commit ·
dd830a2
1
Parent(s): 4319069
fix(nexus): resolved crash in dashboard insights and surgical syntax repair
Browse files- api/v1/dashboard.py +3 -2
api/v1/dashboard.py
CHANGED
|
@@ -333,6 +333,7 @@ async def get_agent_queue(
|
|
| 333 |
|
| 334 |
@router.get("/ai-insights/")
|
| 335 |
async def get_ai_insights(
|
|
|
|
| 336 |
workspace_id: str = None,
|
| 337 |
refresh: bool = False,
|
| 338 |
current_user: User = Depends(get_current_user),
|
|
@@ -390,11 +391,11 @@ async def get_ai_insights(
|
|
| 390 |
|
| 391 |
# 2. Standard Workspace Mode (Isolated)
|
| 392 |
# Gather context
|
| 393 |
-
stats = await get_dashboard_stats(workspace_id, refresh=refresh, current_user=current_user, db=db)
|
| 394 |
|
| 395 |
# Context varies by role: Staff get the full Queue, Customers get their recent activity
|
| 396 |
if is_staff:
|
| 397 |
-
queue = await get_agent_queue(workspace_id, refresh=refresh, current_user=current_user, db=db)
|
| 398 |
else:
|
| 399 |
# Fallback for CUSTOMER_ADMIN/USER: Get their workspace-visible tickets
|
| 400 |
from api.v1.tickets import list_tickets
|
|
|
|
| 333 |
|
| 334 |
@router.get("/ai-insights/")
|
| 335 |
async def get_ai_insights(
|
| 336 |
+
request: Request,
|
| 337 |
workspace_id: str = None,
|
| 338 |
refresh: bool = False,
|
| 339 |
current_user: User = Depends(get_current_user),
|
|
|
|
| 391 |
|
| 392 |
# 2. Standard Workspace Mode (Isolated)
|
| 393 |
# Gather context
|
| 394 |
+
stats = await get_dashboard_stats(request, workspace_id, refresh=refresh, current_user=current_user, db=db)
|
| 395 |
|
| 396 |
# Context varies by role: Staff get the full Queue, Customers get their recent activity
|
| 397 |
if is_staff:
|
| 398 |
+
queue = await get_agent_queue(request, workspace_id, refresh=refresh, current_user=current_user, db=db)
|
| 399 |
else:
|
| 400 |
# Fallback for CUSTOMER_ADMIN/USER: Get their workspace-visible tickets
|
| 401 |
from api.v1.tickets import list_tickets
|