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 better regex #822

Closed
wants to merge 1 commit into from
Closed

Conversation

josephjclark
Copy link
Collaborator

This PR shows simpler regex and a few more tests

const result = shouldUseNewTracker('tracker/events');
expect(result).to.be.true;
});

it('should use the new tracker for trackedEntityInstance', () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test fails right now, but I think it should pass.

I don't think we have support right now to map trackedEntityInstances to tracker/trackeEntities. But I think we should?

We support create('enrollments') and create ('trackedEntities'), so why not create ('trackedEntitiesInstances)?

it('should use the new tracker for trackedEntities', () => {
const result = shouldUseNewTracker('trackedEntities');
expect(result).to.be.true;
});

it('should use the new tracker for new tracker generally', () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. Question mark on this actually.

create should take a resourceType - not a path. So create('enrollments'), not create('tracker/enrollments'). Because create has opinions and does stuff for you.

If you want a custom create with the new tracker, do post('tracker/enrollments')

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

Successfully merging this pull request may close these issues.

1 participant