fix: resolved doctor login and registration
🎨 Display Backend Error Message for Doctor Login
Overview
This MR improves error handling in the Manage Doctors page by displaying a meaningful backend error message instead of a generic HTTP error.
❗ Problem
-
When an unregistered doctor attempted to log in, the UI showed:
- "Request failed with status code 404"
-
This message was not user-friendly and did not explain the actual issue.
✅ Solution
-
Updated error handling to use backend response message:
error.response?.data?.detail
-
Now displays:
- "Doctors must be registered for the camp before logging in."
🎯 Impact
- Provides clear and meaningful feedback to users
- Improves UX by replacing generic technical errors
🧪 Test Case
-
Try logging in with an unregistered doctor
- Expected: "Doctors must be registered for the camp before logging in."
📌 Notes
- This change only updates error messaging
- UI state handling (login button enable/disable) will be addressed separately
Edited by Rajuldev Vandana