-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openmrs: add a generic http request #923
Conversation
Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
packages/openmrs/src/http.js
Outdated
/** | ||
* Make a HTTP request to any OpenMRS endpoint | ||
* @example | ||
* request("GET","http://msf-ocg-openmrs3-dev.westeurope.cloudapp.azure.com/openmrs/ws/rest/v1/patient/d3f7e1a8-0114-4de6-914b-41a11fc8a1a8", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❗ Important! We do not want to allow absolute URLs here. Users should set state.configuration.instanceUrl
I actually think we should throw if an absolute URL is passed
Am I right in thinking that the common adaptor's request will throw if the url is absolute and baseURL has a value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Common does not throw an error, but rather commcare
flags with a 404
if both the instanceUrl
and path
are absolute urls
Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
QA note: check the built docs locally and make sure everything is OK |
Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
@josephjclark The import method is throwing an error. I am researching for another method to reuse the |
@hunterachieng dang, that's a shame. Don't spend much time on this. I was actually hoping the typedef would be available "globally" and you wouldn't need to do anything to be able to use it. Or do some simple namespacing. So if you can't resolve it in less than half an hour, please just copy and paste the typedef |
Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
@josephjclark I have tried other methods like globally but the import is the only one that would have work except its failing on build. I have just copy pasted instead |
packages/openmrs/src/Utils.js
Outdated
@@ -7,6 +7,7 @@ import { | |||
|
|||
/** | |||
* Options object | |||
* @global |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably remove this if we're not keeping it
Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
@hunterachieng can you please generate a Minor changeset for this feature? |
Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few adjustments please :)
Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
Summary
Implement a generic
http
request to allow bothfhir
andnon-fhir
requests to be madeFixes #889
Details
Add technical details of what you've changed (and why).
AI Usage
Please disclose how you've used AI in this work (it's cool, we just want to know!):
You can read more details in our Responsible AI Policy
Review Checklist
Before merging, the reviewer should check the following items:
dev only changes don't need a changeset.