-
Notifications
You must be signed in to change notification settings - Fork 2
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
add missing params for new tracker api #147
base: development
Are you sure you want to change the base?
Conversation
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.
Comments in-line.
(Note: Having the clickup issue in the description of the PR is very handy to add time for the review, specially for PRs for common libraries)
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.
Some minor comments:
src/api/trackerTrackedEntities.ts
Outdated
| "updatedAt"; | ||
}; | ||
|
||
export type TrackedAttributesFields = { type: "id"; id: Id }; |
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.
Typically, TS uses singular names for this kind of types.
src/api/trackerTrackedEntities.ts
Outdated
| "updatedAt"; | ||
}; | ||
|
||
export type TrackedAttributesFields = { type: "id"; id: Id }; |
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.
The name of type makes it clear within the module, but the plain object is created (example: { type: "id", id: "wMhqqPLb7pP", direction: "desc" }
), we don't know what is the model of that id. Maybe type: "trackedEntityAttributeId"
? (+ update README)
…e/tracker-missing-params
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.
[code only review]
📌 References
📝 Implementation
/api/tracker/trackedEntities?order=[attribute_id]:desc
Docs
https://docs.dhis2.org/en/full/develop/dhis-core-version-240/developer-manual.html?#:~:text=Supported%20fields:
Tracked Entities with order param
https://play.im.dhis2.org/stable-2-40-3-1/api/tracker/trackedEntities.json?fields=trackedEntity,attributes&ouMode=ALL&program=IpHINAT79UW&order=w75KJ2mc4zz:desc
pageCount
property for trackedEntities and eventsTracked Entities
https://play.im.dhis2.org/stable-2-40-3-1/api/tracker/trackedEntities.json?fields=trackedEntity,orgUnit&ouMode=ALL&program=IpHINAT79UW&totalPages=true
Events
https://play.im.dhis2.org/stable-2-40-3-1/api/tracker/events.json?fields=event,orgUnit&ouMode=ALL&program=IpHINAT79UW&totalPages=true