Skip to content

Commit 2b72d9a

Browse files
authored
Merge pull request #1344 from topcoder-platform/use-new-workflows-runs-endpoint
Use new workflows runs endpoint
2 parents 408a936 + d434fd9 commit 2b72d9a

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/apps/review/src/lib/hooks/useFetchAiWorkflowRuns.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useCallback, useEffect, useState } from 'react'
22
import useSWR, { SWRResponse } from 'swr'
33

44
import { EnvironmentConfig } from '~/config'
5-
import { xhrGetAsync, xhrGetBlobAsync } from '~/libs/core'
5+
import { xhrGetBlobAsync } from '~/libs/core'
66
import { handleError } from '~/libs/shared/lib/utils/handle-error'
77

88
import { AiFeedbackItem, Scorecard } from '../models'
@@ -119,16 +119,8 @@ export function useFetchAiWorkflowsRuns(
119119
error: fetchError,
120120
isValidating: isLoading,
121121
}: SWRResponse<AiWorkflowRun[], Error> = useSWR<AiWorkflowRun[], Error>(
122-
`${TC_API_BASE_URL}/workflows/${workflowIds.join(',')}/runs?submissionId=${submissionId}`,
122+
`${TC_API_BASE_URL}/workflows/runs?submissionId=${submissionId}`,
123123
{
124-
fetcher: () => Promise.all(
125-
workflowIds.map(workflowId => (
126-
xhrGetAsync<AiWorkflowRun>(
127-
`${TC_API_BASE_URL}/workflows/${workflowId}/runs?submissionId=${submissionId}`,
128-
)
129-
)),
130-
)
131-
.then(results => results.flat()),
132124
isPaused: () => !workflowIds?.length || !submissionId,
133125
},
134126
)

0 commit comments

Comments
 (0)