Skip to content
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

Phase 3: Add rest API helpers #891

Open
aleksa-krolls opened this issue Jan 9, 2025 · 2 comments
Open

Phase 3: Add rest API helpers #891

aleksa-krolls opened this issue Jan 9, 2025 · 2 comments
Assignees

Comments

@aleksa-krolls
Copy link
Member

aleksa-krolls commented Jan 9, 2025

See parent issue #887 for details.

@martalovescoffee
Copy link

@hunterachieng could you please add an estimate to this issue?

@josephjclark
Copy link
Collaborator

Open question!

If we have the http. namespace to handle requests, is there any benefit in maintaining the rest get() and post() functions?

  • Instead of get('patient/d3f7e1a8-0114-4de6-914b-41a11fc8a1a8'), you can just do http.get("/ws/rest/v1/patient/d3f7e1a8-0114-4de6-914b-41a11fc8a1a8")`. Not a big deal.
  • You can use create and search to fetch and create resources. This should be cleaner and easier than using the rest API.

We could also consider getById(resource, ...id) or getResource which takes a resource and one or more ids. this is basically how get works today - I just want to use a different verb to decouple from the HTTP id. This is actually quite a common problem across the adaptors - we need a good synonym for get()

Having typed all this out, I think get(resource, id) is fine. No need for options. Throw if not found? use a throwOnError option?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New Issues
Development

No branches or pull requests

4 participants