Skip to content

Resolve Assign Doctor Page Displays Only 4 Doctors Instead of Full List

Task Completion: Display All Registered Doctors in Assign Doctor Page 🧩 Overview

The Assign Doctor page has been updated to display all registered doctors without filtering based on availability. Doctor availability is now shown as a status badge, but it does not affect visibility.

🔹 Backend Changes ➤ New Endpoint

GET /api/v1/doctors/registered

Returns all registered doctors

Includes their availability status

Added debug log to track total doctors fetched

📌 Purpose: Provide a dedicated API for the Assign Doctor module to avoid affecting existing doctor APIs.

🔹 Frontend Changes 1️⃣ API Layer (api.ts)

Updated getDoctorConsultations()

/api/v1/doctors/registered

️ replaced:

/api/v1/doctors/

2️⃣ AssignDoctorPage.tsx Removed Availability-Based Filtering doctors.filter(d => d.doctor_availability)

️ Now:

doctors

Availability Badge Added

🟢 Available → Green badge

Not Available → Gray badge (Visual indicator only — no filtering)

Debug Logs Added [AssignDoctorPage] Total doctors received from API: {count} [AssignDoctorPage] Doctors rendered in UI: {count}

React Query Improvement queryFn: getDoctorConsultations

Avoided inline function for better caching & performance

🔹 Key Outcomes

All registered doctors are visible Availability shown as status (not a filter) No changes to existing TypeScript types No impact on other modules Dedicated API used only by Assign Doctor page

🧪 Testing Checklist

All registered doctors appear in UI

Available / Not Available badge displays correctly

Doctor list count matches backend log

No console / TypeScript errors

Other doctor features remain unaffected

🔹 Commit Message feat: show all registered doctors in Assign Doctor page with availability status badge

Screenshot_from_2026-02-16_15-39-04Screenshot_from_2026-02-16_15-39-19

Edited by Pavani Nagireddi

Merge request reports

Loading