mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage
synced 2026-04-12 02:38:15 +00:00
fix: setup wizard role guard, Doctor.clinic removal, dial sends agent config
Defect 1: Setup wizard (/setup) now guarded by AdminSetupGuard — CC agents and other non-admin roles are redirected to / instead of seeing the setup wizard they can't complete. Defect 3: Removed all references to Doctor.clinic (relation was replaced by DoctorVisitSlot entity). Updated queries.ts, appointments.tsx, transforms.ts, doctors.tsx, appointment-form.tsx. Defect 6 (frontend side): Dial request now sends agentId and campaignName from localStorage agent config so the sidecar dials with the correct per-agent credentials, not global defaults. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -157,7 +157,13 @@ export const useSip = () => {
|
||||
}, 30000);
|
||||
|
||||
try {
|
||||
const result = await apiClient.post<{ status: string; ucid?: string }>('/api/ozonetel/dial', { phoneNumber });
|
||||
// Send agent config so the sidecar dials with the correct agent ID + campaign
|
||||
const agentConfig = JSON.parse(localStorage.getItem('helix_agent_config') ?? '{}');
|
||||
const result = await apiClient.post<{ status: string; ucid?: string }>('/api/ozonetel/dial', {
|
||||
phoneNumber,
|
||||
agentId: agentConfig.ozonetelAgentId,
|
||||
campaignName: agentConfig.campaignName,
|
||||
});
|
||||
console.log('[DIAL] Dial API response:', result);
|
||||
clearTimeout(safetyTimeout);
|
||||
// Store UCID from dial response — SIP bridge doesn't carry X-UCID for outbound
|
||||
|
||||
Reference in New Issue
Block a user