Skip to content

fix(prescription): fix false 404 when adding a new medicine

Vaishnavi Prabhala requested to merge improving-error-handling into develop

fix(prescription): resolve incorrect 404 error when adding new medicine

Description

This merge request fixes an issue in the medical prescription module where adding a new medicine was incorrectly triggering a 404 Not Found error.

After thorough analysis, it was confirmed that:

  • The request flow and backend logic were functioning correctly
  • The system was misinterpreting the API response
  • This misinterpretation caused an error instead of a successful acknowledgment

Root Cause

The API response for the add-medicine request was being improperly handled, which led to a false 404 Not Found error being surfaced to the frontend.

Resolution

  • Corrected the API response handling logic
  • Ensured that successful add-medicine operations return a proper success response
  • Improved error-handling logic to prevent similar misinterpretations in the future

Impact

This update ensures that:

  • The API now correctly handles the add-medicine request
  • A proper success response is returned instead of an unnecessary 404 error
  • The frontend receives a valid acknowledgment message
  • The overall user experience during prescription entry is smoother and more intuitive
  • The prescription workflow is more reliable and less confusing for doctors and volunteers while adding medicines to a patient’s record

Screenshots

Before Fix

refer comments

After Fix

refer comments

Checklist

  • The bug has been reproduced and confirmed
  • A clear and concise fix has been implemented
  • New tests have been added to prevent regressions
  • Existing tests are passing

Related Issue(s)


Merge request ready for review

Edited by Vaishnavi Prabhala

Merge request reports

Loading