From 42c4a1e2a394fd23ece52caff6f686ca5c6339e5 Mon Sep 17 00:00:00 2001 From: Yashas Date: Fri, 3 Jul 2026 18:50:58 +0530 Subject: [PATCH] sud life frontgen changes --- src/api/client.ts | 2 +- src/api/config.ts | 10 ++++++---- src/pages/Login.tsx | 6 +++++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/api/client.ts b/src/api/client.ts index a011025..8f00bf6 100644 --- a/src/api/client.ts +++ b/src/api/client.ts @@ -90,7 +90,7 @@ export class ZinoClient { const res = await this.request('POST', '/usr/login', { email, password, - ...(orgId ? { org_id: Number(orgId) } : {}), + ...(orgId ? { org_id: String(orgId) } : {}), }); this.setToken(res.token); return res; diff --git a/src/api/config.ts b/src/api/config.ts index 5dbe592..2c4d46d 100644 --- a/src/api/config.ts +++ b/src/api/config.ts @@ -1,9 +1,11 @@ -// Aria Lead-to-Policy — dev app 386, org 53 (cloned from sandbox app 385). -// Workflow `e29c3c33` (v1) — identical source_uuid on dev. ids verified against postgres-dev. +// SUD Life — Lead-to-Policy — dev app 387, org 54 (cloned from sandbox app 385). +// Workflow `e29c3c33` (v1): the clone preserved the sandbox source_uuid, so the +// workflow/activity/state/record-view/detail-view UIDs are reused 1:1. All ids +// below verified against sm_dev_stable (postgres-dev, read-only) for app 387. export const ORG_ID = '54'; export const APP_ID = '387'; -export const WORKFLOW_UUID = '6594f9db-6da9-45a9-b66e-53f78bea2069'; +export const WORKFLOW_UUID = 'e29c3c33-e294-4051-8325-a20de9ed99fc'; // Record views (POST /app/387/view/recordview, body.rv_template_uid). export const RECORD_VIEW_IDS = { @@ -167,7 +169,7 @@ export function aiEmployeeForState(stateName?: string): { name: string; role: st } } -// --- Screen RBAC (mirrors tbl_appconfig_screens.permissions for app 385) --- +// --- Screen RBAC (mirrors tbl_appconfig_screens.permissions for app 387) --- // Roles that bypass screen gating entirely (platform admins see every screen). export const SUPER_ROLES = ['Super Admin', 'Admin']; diff --git a/src/pages/Login.tsx b/src/pages/Login.tsx index a9f6375..28e802e 100644 --- a/src/pages/Login.tsx +++ b/src/pages/Login.tsx @@ -5,6 +5,7 @@ import { ArrowRight, CalendarClock, Eye, EyeOff, Lock, Mail, ShieldCheck, Sparkl import { Button } from '../components'; import { ZinoLogo } from '../components/ZinoLogo'; import { useZino } from '../api/provider'; +import { ORG_ID } from '../api/config'; const HIGHLIGHTS = [ { Icon: Sparkles, title: 'AI employees do the legwork', body: 'Aria qualifies, engages and schedules leads autonomously.' }, @@ -54,7 +55,10 @@ export function Login() { setBusy(true); setError(null); try { - await login(email, password); + // Scope the token to THIS app's org (SUD Life = org 54). sales@zino.com + // exists in multiple orgs, so without org_id the gateway defaults to the + // wrong tenant (org 53) and app-387 activities silently mis-route. + await login(email, password, ORG_ID); navigate(from, { replace: true }); } catch (err) { setError(err instanceof Error ? err.message : ((err as { message?: string })?.message ?? 'Login failed'));