Skip to content

Refactor: Enforce strict Problem typings in problems/page.tsx#217

Merged
MohitBareja16 merged 2 commits into
ThePlator:mainfrom
MohitBareja16:fix/problems-page-types
Jun 1, 2026
Merged

Refactor: Enforce strict Problem typings in problems/page.tsx#217
MohitBareja16 merged 2 commits into
ThePlator:mainfrom
MohitBareja16:fix/problems-page-types

Conversation

@MohitBareja16

@MohitBareja16 MohitBareja16 commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Description

Closes #216

This PR hardens the type safety of the problem library page (frontend/src/app/problems/page.tsx) by removing any types during data iteration.

Changes Made

  • Interface Definition: Created a strict Problem interface mapping to the expected backend schema (tracking _id, slug, title, difficulty, and category).
  • Strict Iteration: Replaced the generic problems.map((problem: any) with problems.map((problem: Problem). This guarantees that the UI rendering logic strictly adheres to the defined schema and will throw compiler errors if properties are manipulated incorrectly.

Verification

  • The Next.js build step successfully passes type-checking for this page.
  • The problem list renders correctly with accurate titles, difficulty tags, and categories.

@vercel

vercel Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

@MohitBareja16 is attempting to deploy a commit to the Sameer's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added level:beginner Beginner level difficulty quality:clean Clean code quality type:refactor Refactor gssoc:approved Approved for GirlScript Summer of Code labels Jun 1, 2026
@MohitBareja16 MohitBareja16 added level:intermediate Intermediate level difficulty quality:exceptional Exceptional code quality and removed level:beginner Beginner level difficulty quality:clean Clean code quality labels Jun 1, 2026
@MohitBareja16 MohitBareja16 merged commit cbc809e into ThePlator:main Jun 1, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved Approved for GirlScript Summer of Code level:intermediate Intermediate level difficulty quality:exceptional Exceptional code quality type:refactor Refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: Enforce strict Problem typings in problems/page.tsx

1 participant