Route view-service calls through /app/{appId}/view/ prefix

This commit is contained in:
Bhanu Prakash Sai Potteri 2026-05-22 22:42:52 +05:30
parent 7ff3638afb
commit 9e8b41a202

View File

@ -57,7 +57,7 @@ export interface NavItem {
}
export async function getHeaderConfig(deviceType = "desktop"): Promise<HeaderConfig> {
const raw = await request<any>("GET", `/app/${APP_ID}/header/${deviceType}`);
const raw = await request<any>("GET", `/app/${APP_ID}/view/header/${deviceType}`);
return raw.config ?? raw;
}
@ -88,11 +88,11 @@ export interface LayoutElement {
}
export function getScreens(deviceType = "desktop"): Promise<ScreenListItem[]> {
return request("GET", `/app/${APP_ID}/screens?device_type=${deviceType}`);
return request("GET", `/app/${APP_ID}/view/screens?device_type=${deviceType}`);
}
export function getScreen(sourceScreenId: number): Promise<ScreenLayout> {
return request("GET", `/app/${APP_ID}/screens/${sourceScreenId}`);
return request("GET", `/app/${APP_ID}/view/screens/${sourceScreenId}`);
}
// ---------------------------------------------------------------------------
@ -110,7 +110,7 @@ export interface RVScreen {
// Accepts either the numeric source_screen_id OR the source_uuid — both
// are accepted by the view-service's rv-screens endpoint.
export function getRVScreen(idOrUuid: number | string): Promise<RVScreen> {
return request("GET", `/app/${APP_ID}/rv-screens/${idOrUuid}`);
return request("GET", `/app/${APP_ID}/view/rv-screens/${idOrUuid}`);
}
// ---------------------------------------------------------------------------
@ -152,7 +152,7 @@ export function getRecordView(
rvScreenId: string | number,
query: SearchQuery = {},
): Promise<RecordViewResponse> {
return request("POST", `/app/${APP_ID}/recordview`, {
return request("POST", `/app/${APP_ID}/view/recordview`, {
rv_template_id: rvTemplateId,
rv_screen_id: String(rvScreenId),
search_query: {
@ -198,7 +198,7 @@ export interface DVScreen {
}
export function getDVScreen(idOrUuid: number | string): Promise<DVScreen> {
return request("GET", `/app/${APP_ID}/dv-screens/${idOrUuid}`);
return request("GET", `/app/${APP_ID}/view/dv-screens/${idOrUuid}`);
}
// ---------------------------------------------------------------------------
@ -213,7 +213,7 @@ export interface DetailViewResponse {
export function getDetailView(dvSourceId: number, instanceId: string): Promise<DetailViewResponse> {
return request(
"GET",
`/app/${APP_ID}/detailview/${dvSourceId}?instance_id=${encodeURIComponent(instanceId)}`,
`/app/${APP_ID}/view/detailview/${dvSourceId}?instance_id=${encodeURIComponent(instanceId)}`,
);
}
@ -254,7 +254,7 @@ export function getFormScreen(
instanceId?: string,
deviceType = "desktop",
): Promise<FormScreenResponse> {
return request("POST", `/app/${APP_ID}/form-screens`, {
return request("POST", `/app/${APP_ID}/view/form-screens`, {
activity_id: activityId,
instance_id: instanceId || "",
device_type: deviceType,
@ -353,5 +353,5 @@ export interface AuditEntry {
}
export function getAuditLog(instanceId: string): Promise<AuditEntry[]> {
return request("GET", `/app/${APP_ID}/audit?instance_id=${encodeURIComponent(instanceId)}`);
return request("GET", `/app/${APP_ID}/view/audit?instance_id=${encodeURIComponent(instanceId)}`);
}