fix(submissions): consume flat UserSubmissionResponse[] instead of nested .submission/.results

Abierto
#26 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript
Área
frontend

Línea de trabajo

Start in src/api/submissions.ts, where getUserSubmissions() wraps the flat backend array into the nested UserWithSubmissions shape, then read the UserSubmissionsPage component that consumes it. Compare against the UserSubmissionResponse fields the issue lists. Done when the page renders the flat list without crashing, the legacy UserWithSubmissions type is removed, and the layout change is agreed with a maintainer, since the two-panel-to-list redesign is a design choice.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement
Problem

What is missing or painful today?

Backend GET /admin/users/:id/submissions returns a flat array of
UserSubmissionResponse {id, question_title, question_round, testcases_passed,
testcases_failed, runtime, memory, status, source_code, submission_time}.
Frontend getUserSubmissions() wraps this into UserWithSubmissions with nested
.submission and .results (always []), causing runtime crashes when opening a
user's submissions page.

The flat array from the backend has all the information needed question title,
timestamp, status, pass/fail counts, runtime, memory, and source code but the
frontend forces it into a broken nested structure that doesn't match the API.

Proposed solution

Proposed solution

  1. Rewrite getUserSubmissions() in src/api/submissions.ts to return
    flat SubmissionWithResultsAndTestcases[] directly from the response.
  2. Update UserSubmissionsPage to display flat data: question title,
    timestamp, status badge (ACCEPTED/FAILED), pass/fail counts, runtime,
    memory, and source code viewer with copy button.
  3. Remove the legacy UserWithSubmissions type and the broken nested
    .submission/.results structure.
  4. Update the UserSubmissionsPage layout to use a single scrollable
    list with expandable source code rows instead of the current
    two-panel split design.
Alternatives considered

No response

Lenguaje dominante
TypeScript
Estrellas
0
Forks
1
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de CodeChefVIT/cookoff-admin-11.0

Todos los issues de CodeChefVIT/cookoff-admin-11.0

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.