diff --git a/src/api/viewService.ts b/src/api/viewService.ts index 19595f2..c1c1e69 100644 --- a/src/api/viewService.ts +++ b/src/api/viewService.ts @@ -257,10 +257,13 @@ export function getFormScreen( instanceId?: string, deviceType = "desktop", ): Promise { + const numericInstanceId = instanceId ? Number(instanceId) : undefined; return request("POST", `/app/${APP_ID}/view/form-screens`, { activity_id: activityId, device_type: deviceType, - ...(instanceId ? { instance_id: instanceId } : {}), + ...(numericInstanceId && !Number.isNaN(numericInstanceId) + ? { instance_id: numericInstanceId } + : {}), }); }