vets-who-code-app icon indicating copy to clipboard operation
vets-who-code-app copied to clipboard

Replace `any[]` with typed Enrollment interface in dashboard

Open Copilot opened this issue 2 months ago • 2 comments

Addresses code review feedback to eliminate any[] type that defeats TypeScript's type safety for enrollment data.

Changes

  • Created src/types/enrollment.ts: Defines Enrollment, EnrollmentStats, Course, and EnrollmentStatus types matching the API response structure from /api/enrollment
  • Updated src/pages/dashboard.tsx: Replaced useState<any[]> with useState<Enrollment[]>

Example

// Before
const [enrollments, setEnrollments] = useState<any[]>([]);

// After
import type { Enrollment } from "@/types/enrollment";
const [enrollments, setEnrollments] = useState<Enrollment[]>([]);

The type definitions cover all fields accessed in the dashboard: id, status, enrolledAt, course.{id,title,description}, and stats.{completedLessons,totalLessons,progressPercentage}.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot avatar Dec 05 '25 04:12 Copilot

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
vets-who-code-app Error Error Dec 5, 2025 4:59am

vercel[bot] avatar Dec 05 '25 04:12 vercel[bot]

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

[!WARNING]

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • checkpoint.prisma.io
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/vets-who-code-app/vets-who-code-app/node_modules/prisma/build/child {&#34;product&#34;:&#34;prisma&#34;,&#34;version&#34;:&#34;6.10.1&#34;,&#34;cli_install_type&#34;:&#34;local&#34;,&#34;information&#34;:&#34;&#34;,&#34;local_timestamp&#34;:&#34;2025-12-05T04:55:08Z&#34;,&#34;project_hash&#34;:&#34;4713398e&#34;,&#34;cli_path&#34;:&#34;/home/REDACTED/work/vets-who-code-app/vets-who-code-app/node_modules/.bin/prisma&#34;,&#34;cli_path_has (dns block)
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/vets-who-code-app/vets-who-code-app/node_modules/prisma/build/child {&#34;product&#34;:&#34;prisma&#34;,&#34;version&#34;:&#34;6.10.1&#34;,&#34;cli_install_type&#34;:&#34;local&#34;,&#34;information&#34;:&#34;&#34;,&#34;local_timestamp&#34;:&#34;2025-12-05T04:55:10Z&#34;,&#34;project_hash&#34;:&#34;4713398e&#34;,&#34;cli_path&#34;:&#34;/home/REDACTED/work/vets-who-code-app/vets-who-code-app/node_modules/.bin/prisma&#34;,&#34;cli_path_has (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot avatar Dec 05 '25 05:12 Copilot