feat: add challenge and red-blue competitions across API and web
This commit is contained in:
parent
f5161d9add
commit
8fd3c4bb64
77 changed files with 5355 additions and 24 deletions
27
web/service/console/redBlueChallenges.ts
Normal file
27
web/service/console/redBlueChallenges.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { request } from '@/service/base'
|
||||
|
||||
export type ConsoleRedBlueChallenge = {
|
||||
id: string
|
||||
name: string
|
||||
description?: string
|
||||
is_active?: boolean
|
||||
}
|
||||
|
||||
export async function listConsoleRedBlueChallenges() {
|
||||
const resp = await request<{ data: ConsoleRedBlueChallenge[] }>('/red-blue-challenges', {}, {})
|
||||
return resp.data
|
||||
}
|
||||
|
||||
export async function createConsoleRedBlueChallenge(payload: {
|
||||
tenant_id: string
|
||||
app_id: string
|
||||
name: string
|
||||
description?: string
|
||||
judge_suite: Record<string, any>
|
||||
}) {
|
||||
const resp = await request<{ data: { id: string } }>('/red-blue-challenges', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(payload),
|
||||
}, {})
|
||||
return resp.data
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue