diff --git a/src/routes/api/workflows/[workflow]/[run]/history.ts b/src/routes/api/workflows/[workflow]/[run]/history.ts index efdb68fa94..939309d6c3 100644 --- a/src/routes/api/workflows/[workflow]/[run]/history.ts +++ b/src/routes/api/workflows/[workflow]/[run]/history.ts @@ -1,12 +1,12 @@ import type { Request, EndpointOutput } from '@sveltejs/kit'; -const apiHost = process.env.TEMPORAL_API_HOST || 'http://localhost:8088'; +const apiHost = process.env.TEMPORAL_API_HOST || 'http://localhost:8080'; export async function get({ params }: Request): Promise { const { workflow: workflowId, run: runId } = params; const response = await fetch( - `${apiHost}/api/namespaces/default/workflows/${workflowId}/${runId}/history?{query}`, + `${apiHost}/api/v1/namespaces/default/workflows/${workflowId}/${runId}/history?{query}`, ); const history = await response.json(); diff --git a/src/routes/api/workflows/[workflow]/[run]/index.ts b/src/routes/api/workflows/[workflow]/[run]/index.ts index 7ef2a2c240..207e741174 100644 --- a/src/routes/api/workflows/[workflow]/[run]/index.ts +++ b/src/routes/api/workflows/[workflow]/[run]/index.ts @@ -1,12 +1,12 @@ import type { Request, EndpointOutput } from '@sveltejs/kit'; -const apiHost = process.env.TEMPORAL_API_HOST || 'http://localhost:8088'; +const apiHost = process.env.TEMPORAL_API_HOST || 'http://localhost:8080'; export async function get({ params }: Request): Promise { const { workflow: workflowId, run: runId } = params; const response = await fetch( - `${apiHost}/api/namespaces/default/workflows/${workflowId}/${runId}`, + `${apiHost}/api/v1/namespaces/default/workflows/${workflowId}/${runId}`, ); const workflow = await response.json(); diff --git a/src/routes/api/workflows/index.ts b/src/routes/api/workflows/index.ts index b7c40f0edb..792adac937 100644 --- a/src/routes/api/workflows/index.ts +++ b/src/routes/api/workflows/index.ts @@ -1,4 +1,6 @@ -const apiHost = process.env.TEMPORAL_API_HOST || 'http://localhost:8088'; +import type { ListWorkflowExecutionsResponse } from '$types/temporal/api/workflowservice/v1/request_response'; + +const apiHost = process.env.TEMPORAL_API_HOST || 'http://localhost:8080'; /* * TODO: Add better error handling. @@ -11,9 +13,9 @@ const apiHost = process.env.TEMPORAL_API_HOST || 'http://localhost:8088'; const fetchWorkflows: ( type: string, query: URLSearchParams, -) => Promise = async (type, query) => { +) => Promise = async (type, query) => { const response = await fetch( - `${apiHost}/api/namespaces/default/workflows/${type}?${query.toString()}`, + `${apiHost}/api/v1/namespaces/default/workflows/${type}?${query.toString()}`, ); return await response.json(); }; diff --git a/src/routes/workflows/__layout.svelte b/src/routes/workflows/__layout.svelte index 902fc5adbf..51b0b065d3 100644 --- a/src/routes/workflows/__layout.svelte +++ b/src/routes/workflows/__layout.svelte @@ -6,7 +6,10 @@ const startTime = subDays(new Date(), 30).toISOString(); const endTime = addDays(new Date(), 30).toISOString(); - const query = new URLSearchParams({ startTime, endTime }); + const query = new URLSearchParams({ + 'start_time_filter.earliest_time': startTime, // TODO field names should come from ListWorkflowExecutionsRequest + 'start_time_filter.latest_time': endTime, + }); const response = await fetch(`/api/workflows?${query}`); if (!response.ok) {