Commit 9c6c7def authored by Siddique's avatar Siddique
Browse files

Docker fix

parent 41f78a0d
......@@ -2,6 +2,9 @@ server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
client_max_body_size 50m;
location = /health {
......
......@@ -335,9 +335,8 @@ export async function getRunReviewSummary(runId: string): Promise<ReviewSummaryR
}
export async function getRunHistory(runType: RunType = "grading"): Promise<RunHistoryResponse> {
const url = new URL(`${API_BASE_URL}/runs`)
url.searchParams.set("run_type", runType)
const response = await fetch(url.toString())
const searchParams = new URLSearchParams({ run_type: runType })
const response = await fetch(`${API_BASE_URL}/runs?${searchParams.toString()}`)
if (!response.ok) {
const message = await parseError(response)
......@@ -376,11 +375,14 @@ export async function getRunStudents(
page = 1,
pageSize = 200
): Promise<RunStudentsResponse> {
const url = new URL(`${API_BASE_URL}/runs/${encodeURIComponent(runId)}/students`)
url.searchParams.set("page", String(page))
url.searchParams.set("page_size", String(pageSize))
const searchParams = new URLSearchParams({
page: String(page),
page_size: String(pageSize)
})
const response = await fetch(url.toString())
const response = await fetch(
`${API_BASE_URL}/runs/${encodeURIComponent(runId)}/students?${searchParams.toString()}`
)
if (!response.ok) {
const message = await parseError(response)
......@@ -421,15 +423,18 @@ export async function getQuestionAnswers(
scoreScale?: LabelScaleKey
} = {}
): Promise<QuestionAnswersResponse> {
const url = new URL(
`${API_BASE_URL}/runs/${encodeURIComponent(runId)}/questions/${questionId}/answers`
const searchParams = new URLSearchParams({
page: String(page),
page_size: String(pageSize)
})
if (filters.scoreScale) searchParams.set("score_scale", filters.scoreScale)
filters.predictedScores?.forEach(score =>
searchParams.append("predicted_score", String(score))
)
url.searchParams.set("page", String(page))
url.searchParams.set("page_size", String(pageSize))
if (filters.scoreScale) url.searchParams.set("score_scale", filters.scoreScale)
filters.predictedScores?.forEach(score => url.searchParams.append("predicted_score", String(score)))
const response = await fetch(url.toString())
const response = await fetch(
`${API_BASE_URL}/runs/${encodeURIComponent(runId)}/questions/${questionId}/answers?${searchParams.toString()}`
)
if (!response.ok) {
const message = await parseError(response)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment