-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
✨ PATCH items (CRUD) #267
✨ PATCH items (CRUD) #267
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #267 +/- ##
==========================================
+ Coverage 56.39% 60.71% +4.32%
==========================================
Files 42 42
Lines 1204 1227 +23
Branches 298 310 +12
==========================================
+ Hits 679 745 +66
+ Misses 486 444 -42
+ Partials 39 38 -1 ☔ View full report in Codecov by Sentry. |
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.
Description
This PRs removes an ambiguity updating items (see #265). Updating an item leaving props and relations blank/empty results in a strange behavior:
This PRs distinguishes between both behaviors by proposing a PATCH method in addition to the PUT method:
PUT method does a full replacement of props and relations (empty props/relations are considered deleted)
PATCH method does a partial update touching only the props and relations present in the body
Related DOC PR
Related Issues
How can it be tested?
Get the related doc from the website repository replacing
docs/fetch-content.sh
byAnd then run
npm run fetch-content
and browse the documentation to play around.I recommend using Postman to update existing items that have relations with both PUT and PATCH methods to see if it does as it says.
Impacted packages
Check the NPM packages that require a new publication or release:
Check list before submitting
npx changeset