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

dhis2: API changes #981

Open
josephjclark opened this issue Feb 5, 2025 · 2 comments
Open

dhis2: API changes #981

josephjclark opened this issue Feb 5, 2025 · 2 comments

Comments

@josephjclark
Copy link
Collaborator

josephjclark commented Feb 5, 2025

create

  • Remove options object (unless anyone can think of a good use for it?
  • remove callback
  • Maybe fewer examples?
  • Should the resourceType be singular? ie create('program') not create('programs')
  • Is the create('tracker') API nonsense? Surely that's post('tracker')?
  • Should we throw if a path is passed?

destroy

  • remove optoins
  • remove callback
  • Docs are wrong (not "a generic helper function"). Dead link too.
  • Maybe signature should be destroy(resourceType, resourceOrPath), where resourceOrPath can be a string or array of strings. Ie let me remove multiple things in one call.

update

  • remove options and callback
  • not "a generic helper function".

upsert

  • remove options and callback
  • not "a generic helper function".

maybe include #598 suggestions?

@github-project-automation github-project-automation bot moved this to New Issues in v2 Feb 5, 2025
@josephjclark
Copy link
Collaborator Author

upsert uses this query object to select what to upsert. that's kind of interesting. Should this be the general pattern? Take a selector argument which can be an id, a path, or a query object? That would apply to all main operations

@josephjclark
Copy link
Collaborator Author

I am upset about pluralisation in upsert('trackedEntities'). Shouldn't it be 'trackedEntity'?

This applies to all helpers. It's unintuitive unless you think in terms of the dhis2 API (which of course this maps to).

I am not sure if it's more or less annoying to use singular resource types. Maybe we should provide a mapping to optionally support singular forms? It's a bit more effort but it'll really help users I think

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

1 participant