Implement chain submissions API and update frontend to utilize new endpoint; enhance submissions page with feature flag for API selection, participant progress display, and improved filtering logic.
This commit is contained in:
@@ -15,6 +15,8 @@ import type {
|
||||
UpdateChainRequest,
|
||||
SubmitRequest,
|
||||
TestSubmissionResult,
|
||||
ChainSubmissionsResponse,
|
||||
SubmissionStatus,
|
||||
} from '../../types/challenge'
|
||||
|
||||
export const api = createApi({
|
||||
@@ -143,6 +145,17 @@ export const api = createApi({
|
||||
transformResponse: (response: { body: ChallengeSubmission[] }) => response.body,
|
||||
providesTags: ['Submission'],
|
||||
}),
|
||||
getChainSubmissions: builder.query<
|
||||
ChainSubmissionsResponse,
|
||||
{ chainId: string; userId?: string; status?: SubmissionStatus }
|
||||
>({
|
||||
query: ({ chainId, userId, status }) => ({
|
||||
url: `/challenge/chain/${chainId}/submissions`,
|
||||
params: userId || status ? { userId, status } : undefined,
|
||||
}),
|
||||
transformResponse: (response: { body: ChainSubmissionsResponse }) => response.body,
|
||||
providesTags: ['Submission'],
|
||||
}),
|
||||
|
||||
// Test submission (LLM check without creating a real submission)
|
||||
testSubmission: builder.mutation<TestSubmissionResult, SubmitRequest>({
|
||||
@@ -178,6 +191,7 @@ export const {
|
||||
useGetSystemStatsV2Query,
|
||||
useGetUserStatsQuery,
|
||||
useGetUserSubmissionsQuery,
|
||||
useGetChainSubmissionsQuery,
|
||||
useTestSubmissionMutation,
|
||||
} = api
|
||||
|
||||
|
||||
Reference in New Issue
Block a user