Skip to content

refactor: extract shared vendor category constants #68

Description

@EmeditWeb

Problem

The vendor category list is defined in 3 separate files with slightly different values:

  • src/pages/Home.tsx (line 207-214): Bootcamps, Online Courses, Universities, Platforms
  • src/pages/VendorRegister.tsx (line 11): Bootcamp, OnlineCourse, University, Platform
  • src/pages/Vendors.tsx (line 11): same as VendorRegister

The pluralization and naming inconsistencies cause filtering to fail across pages. A vendor registered as "Bootcamp" will not show under "Bootcamps" filter.

Root Cause

The categories list was copied independently into each file during development rather than extracted to a shared constant.

What To Build

  1. Create src/constants/categories.ts with the canonical category list
  2. Import from the shared constant in all 3 files
  3. Ensure consistent naming (pick one convention: Bootcamp or Bootcamps)
  4. Update existing vendors in DB to match the canonical names

Files To Touch

  • src/constants/categories.ts — new file
  • src/pages/Home.tsx — remove local CATEGORIES, import shared
  • src/pages/VendorRegister.tsx — remove local CATEGORIES, import shared
  • src/pages/Vendors.tsx — remove local CATEGORIES, import shared

Acceptance Criteria

  • Categories defined once in src/constants/categories.ts
  • All 3 files import from shared constant
  • Consistent naming across all pages
  • No duplicate category definitions in the codebase

Mandatory Checks

  • context/ files read
  • npm run build passes
  • PR references this issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions