diff --git a/src/api/viewService.ts b/src/api/viewService.ts index 91565e3..19595f2 100644 --- a/src/api/viewService.ts +++ b/src/api/viewService.ts @@ -193,7 +193,7 @@ export interface DVScreen { id: number; source_screen_id: number; screen_name: string; - dv_template_id: number; + dv_template_uid: string; layout?: any; } @@ -210,10 +210,10 @@ export interface DetailViewResponse { data: Record; } -export function getDetailView(dvSourceId: number, instanceId: string): Promise { +export function getDetailView(dvSourceIdOrUid: number | string, instanceId: string): Promise { return request( "GET", - `/app/${APP_ID}/view/detailview/${dvSourceId}?instance_id=${encodeURIComponent(instanceId)}`, + `/app/${APP_ID}/view/detailview/${encodeURIComponent(String(dvSourceIdOrUid))}?instance_id=${encodeURIComponent(instanceId)}`, ); } diff --git a/src/components/DetailViewPanel.tsx b/src/components/DetailViewPanel.tsx index 43b6297..fc8794e 100644 --- a/src/components/DetailViewPanel.tsx +++ b/src/components/DetailViewPanel.tsx @@ -99,8 +99,8 @@ export default function DetailViewPanel({ viewId, instanceId }: Props) { if (!instanceId) return; setLoading(true); setError(null); getDVScreen(viewId) - .then(dv => getDetailView(dv.dv_template_id, instanceId)) - .catch(() => getDetailView(Number(viewId) || 0, instanceId)) + .then(dv => getDetailView(dv.dv_template_uid, instanceId)) + .catch(() => getDetailView(viewId, instanceId)) .then(res => { setFields(res.config?.fields?.filter((f: any) => f.field_key !== "") ?? []); setData(res.data ?? {});