Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Error while searching appointments #2029

Closed
akshay-ap opened this issue Apr 30, 2020 · 2 comments · Fixed by #2031
Closed

Error while searching appointments #2029

akshay-ap opened this issue Apr 30, 2020 · 2 comments · Fixed by #2031

Comments

@akshay-ap
Copy link
Contributor

🐛 Bug Report

Special characters in input string causing issue.

To Reproduce

Steps to reproduce the behavior:

  1. Create a patient
  2. Navigate to Patient details
  3. Click appointments tab.
  4. Enter text in search box.
  5. Click search.

image

Problemtic inputs:

  1. String ending with \ or [
  2. *
  3. {<number>}
    The list is not exhaustive.

Expected behavior

No error.

A clear and concise description of what you expected to happen.

Your Environment

  • node version: 14
  • fastify version: >=1.0.0
  • os: Windows

Similar to: #1999

@JDarke
Copy link
Contributor

JDarke commented Apr 30, 2020

I'm working on #1999; Once my submitted fix is accepted, I can apply it to the rest of the inputs to escape all special regex characters.

JDarke added a commit to JDarke/hospitalrun-frontend that referenced this issue May 1, 2020
Added escapeStringRegex to AppointmentRepository, and associated test suite in
src/__tests__/clients/db/AppointmentRepository.test.ts.  This escapes regex chars included in the
search field in patient info > appointments area

fix HospitalRun#2029
JDarke added a commit to JDarke/hospitalrun-frontend that referenced this issue May 1, 2020
Added escapeStringRegexp to AppointmentRepository.ts to escape regex chars in appointment search
feild in patient info area.

fix HospitalRun#2029
@JDarke
Copy link
Contributor

JDarke commented May 1, 2020

Sorry about the multiple commits. I tried resetting my local repo and then making the changes again, as my master branch was out of sync with the master repo and things were getting untidy. Looks like I still managed to send multiple commits. :|

If anyone could give me an idea of how to submit a PR without having my previous 43 commits linked to it, I'd be very grateful!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants