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

fix: use json+patch for PATCH requests #1593

Merged
merged 2 commits into from
Nov 7, 2023
Merged

fix: use json+patch for PATCH requests #1593

merged 2 commits into from
Nov 7, 2023

Conversation

edoardo
Copy link
Member

@edoardo edoardo commented Nov 6, 2023

Fixes DHIS2-16154

Relates to dhis2/line-listing-app#455


Key features

  1. fix PATCH request in FileMenu -> Rename
  2. fix PATCH request in custom calculations

Description

In some cases we don't want to send the whole payload when updating some object via an api request.
Before we used an update request type with partial set to true in app-runtime.
This type of PATCH request is deprecated.
The new way of doing this is by using a json+patch request.
app-runtime supports this but some changes are needed in our apps wherever a partial update is used.


Screenshots

Before, adding/editing a description in the rename dialog throws an error:
Screenshot 2023-11-06 at 14 17 43

After, adding/editing the description in the rename dialog works, the payload is now formatted as json+patch:
Screenshot 2023-11-06 at 14 20 36
Screenshot 2023-11-06 at 14 22 51

@edoardo edoardo merged commit bdb0b9c into master Nov 7, 2023
3 checks passed
@edoardo edoardo deleted the fix/patch-requests branch November 7, 2023 09:06
dhis2-bot added a commit that referenced this pull request Nov 7, 2023
## [26.1.6](v26.1.5...v26.1.6) (2023-11-07)

### Bug Fixes

* use json+patch for PATCH requests ([#1593](#1593)) ([bdb0b9c](bdb0b9c))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 26.1.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants