Add duplicate and clear submissions functionality for challenge chains; implement corresponding dialogs and API endpoints, enhancing user experience and task management. Update localization for new features in English and Russian.
This commit is contained in:
@@ -13,6 +13,8 @@ import type {
|
||||
UpdateTaskRequest,
|
||||
CreateChainRequest,
|
||||
UpdateChainRequest,
|
||||
DuplicateChainRequest,
|
||||
ClearSubmissionsResponse,
|
||||
SubmitRequest,
|
||||
TestSubmissionResult,
|
||||
ChainSubmissionsResponse,
|
||||
@@ -115,6 +117,23 @@ export const api = createApi({
|
||||
}),
|
||||
invalidatesTags: ['Chain'],
|
||||
}),
|
||||
duplicateChain: builder.mutation<ChallengeChain, { chainId: string; name?: string }>({
|
||||
query: ({ chainId, name }) => ({
|
||||
url: `/challenge/chain/${chainId}/duplicate`,
|
||||
method: 'POST',
|
||||
body: name ? { name } : {},
|
||||
}),
|
||||
transformResponse: (response: { body: ChallengeChain }) => response.body,
|
||||
invalidatesTags: ['Chain'],
|
||||
}),
|
||||
clearChainSubmissions: builder.mutation<ClearSubmissionsResponse, string>({
|
||||
query: (chainId) => ({
|
||||
url: `/challenge/chain/${chainId}/submissions`,
|
||||
method: 'DELETE',
|
||||
}),
|
||||
transformResponse: (response: { body: ClearSubmissionsResponse }) => response.body,
|
||||
invalidatesTags: ['Chain', 'Submission'],
|
||||
}),
|
||||
|
||||
// Statistics
|
||||
getSystemStats: builder.query<SystemStats, void>({
|
||||
@@ -187,6 +206,8 @@ export const {
|
||||
useCreateChainMutation,
|
||||
useUpdateChainMutation,
|
||||
useDeleteChainMutation,
|
||||
useDuplicateChainMutation,
|
||||
useClearChainSubmissionsMutation,
|
||||
useGetSystemStatsQuery,
|
||||
useGetSystemStatsV2Query,
|
||||
useGetUserStatsQuery,
|
||||
|
||||
Reference in New Issue
Block a user