Switch workflow identifier to UUID under workflow_uuid
This commit is contained in:
parent
ebb051aa5c
commit
16fd7cf738
@ -273,22 +273,28 @@ export interface WorkflowResponse {
|
|||||||
instance_id?: string;
|
instance_id?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Core-service expects the workflow UUID as `workflow_uuid` — the numeric
|
||||||
|
// `workflow_id` field was removed when the clone-portable identifier rolled out.
|
||||||
export function startWorkflow(
|
export function startWorkflow(
|
||||||
workflowId: string,
|
workflowUuid: string,
|
||||||
activityId: string,
|
activityId: string,
|
||||||
data?: Record<string, unknown>,
|
data?: Record<string, unknown>,
|
||||||
): Promise<WorkflowResponse> {
|
): Promise<WorkflowResponse> {
|
||||||
return request("POST", `/app/${APP_ID}/start`, { workflow_id: workflowId, activity_id: activityId, data });
|
return request("POST", `/app/${APP_ID}/start`, {
|
||||||
|
workflow_uuid: workflowUuid,
|
||||||
|
activity_id: activityId,
|
||||||
|
data,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function performActivity(
|
export function performActivity(
|
||||||
workflowId: string,
|
workflowUuid: string,
|
||||||
instanceId: string,
|
instanceId: string,
|
||||||
activityId: string,
|
activityId: string,
|
||||||
data?: Record<string, unknown>,
|
data?: Record<string, unknown>,
|
||||||
): Promise<WorkflowResponse> {
|
): Promise<WorkflowResponse> {
|
||||||
return request("POST", `/app/${APP_ID}/activity`, {
|
return request("POST", `/app/${APP_ID}/activity`, {
|
||||||
workflow_id: workflowId,
|
workflow_uuid: workflowUuid,
|
||||||
instance_id: instanceId,
|
instance_id: instanceId,
|
||||||
activity_id: activityId,
|
activity_id: activityId,
|
||||||
data,
|
data,
|
||||||
@ -296,14 +302,14 @@ export function performActivity(
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function submitForm(
|
export function submitForm(
|
||||||
workflowId: string,
|
workflowUuid: string,
|
||||||
activityId: string,
|
activityId: string,
|
||||||
formData: Record<string, unknown>,
|
formData: Record<string, unknown>,
|
||||||
instanceId?: string,
|
instanceId?: string,
|
||||||
deviceType = "desktop",
|
deviceType = "desktop",
|
||||||
): Promise<WorkflowResponse> {
|
): Promise<WorkflowResponse> {
|
||||||
return request("POST", `/app/${APP_ID}/form/submit`, {
|
return request("POST", `/app/${APP_ID}/form/submit`, {
|
||||||
workflow_id: workflowId,
|
workflow_uuid: workflowUuid,
|
||||||
activity_id: activityId,
|
activity_id: activityId,
|
||||||
device_type: deviceType,
|
device_type: deviceType,
|
||||||
form_data: formData,
|
form_data: formData,
|
||||||
@ -325,9 +331,9 @@ export interface InstanceResponse {
|
|||||||
updated_at: string;
|
updated_at: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getInstance(workflowId: string, instanceId: string): Promise<InstanceResponse> {
|
export function getInstance(workflowUuid: string, instanceId: string): Promise<InstanceResponse> {
|
||||||
return request("POST", `/app/${APP_ID}/instance`, {
|
return request("POST", `/app/${APP_ID}/instance`, {
|
||||||
workflow_id: workflowId,
|
workflow_uuid: workflowUuid,
|
||||||
instance_id: instanceId,
|
instance_id: instanceId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,8 @@
|
|||||||
export const ORG_ID = "43";
|
export const ORG_ID = "43";
|
||||||
export const APP_ID = "164";
|
export const APP_ID = "164";
|
||||||
|
|
||||||
export const WORKFLOW_ID = "29347";
|
// Core-service expects the workflow UUID (clone-portable) under `workflow_uuid`.
|
||||||
|
export const WORKFLOW_ID = "17670bed-d52c-455c-87cd-0c1a34417b4a";
|
||||||
|
|
||||||
export const ACTIVITY_IDS = {
|
export const ACTIVITY_IDS = {
|
||||||
INIT_ACTIVITY: "d951de1f-282f-4156-88c3-5bb3bb60d499", // INIT — Sales Agent captures lead
|
INIT_ACTIVITY: "d951de1f-282f-4156-88c3-5bb3bb60d499", // INIT — Sales Agent captures lead
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user