Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Yes, we can delete patch as update does already the job #53

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

elias-ba
Copy link
Contributor

In DHIS2 it's very possible to update a resource by just sending the parts we wanna update. Expression's like this:

update('programStages', 'eaDHS084uMp', {
  name: 'ANC 1st visit',
});

work very well.

@elias-ba elias-ba self-assigned this Dec 24, 2021
Copy link
Member

@taylordowns2000 taylordowns2000 left a comment

Choose a reason for hiding this comment

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

I'm still seeing this in the DHIS2 web api docs: https://docs.dhis2.org/en/develop/using-the-api/dhis-core-version-235/web-api.html#webapi_partial_updates

I know it's possible that those docs are out of date, but it still seems strange that they make sure a big point of "partial updates".

Also, if we delete this I wonder if it's worth giving an example of changing the the http request method in update to use patch instead of put. Something like:

update(resourceType, path, data, {
  requestConfig: { method: 'PATCH' }
})

Also, it looks like the changes to ast.json are unintentional here. I bet you need to run npm install to get the latest version of simple-ast, but please take care to keep unintentional changes out of PRs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants