(challenge_id: str, payload: StatusIn)
| 602 | |
| 603 | @app.post("/api/admin/challenges/{challenge_id}/status") |
| 604 | def update_status(challenge_id: str, payload: StatusIn) -> dict: |
| 605 | with connect() as conn: |
| 606 | cur = conn.execute( |
| 607 | "UPDATE challenges SET status = ? WHERE id = ?", |
| 608 | (payload.status, challenge_id), |
| 609 | ) |
| 610 | if cur.rowcount == 0: |
| 611 | raise HTTPException(status_code=404, detail="Challenge not found") |
| 612 | row = conn.execute( |
| 613 | "SELECT * FROM challenges WHERE id = ?", (challenge_id,) |
| 614 | ).fetchone() |
| 615 | return {"challenge": public_challenge(conn, row)} |
| 616 | |
| 617 | |
| 618 | frontend_dist = ROOT_DIR / "frontend" / "dist" |
nothing calls this directly
no test coverage detected