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
enhancement!: create should send 201 status code #19869
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
innerdvations
changed the title
enhancement: log when server restarts
enhancement: create should send 201 status code
Mar 21, 2024
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
innerdvations
changed the title
enhancement: create should send 201 status code
fix: create should send 201 status code
Mar 21, 2024
innerdvations
added
source: core:strapi
Source is core/strapi package
pr: fix
This PR is fixing a bug
labels
Mar 21, 2024
jhoward1994
reviewed
Apr 12, 2024
jhoward1994
reviewed
Apr 12, 2024
packages/core/content-releases/server/src/controllers/__tests__/release-action.test.ts
Outdated
Show resolved
Hide resolved
innerdvations
changed the title
fix: create should send 201 status code
fix!: create should send 201 status code
Apr 12, 2024
innerdvations
added
the
flag: 💥 Breaking change
This PR contains breaking changes and should not be merged
label
Apr 12, 2024
jhoward1994
approved these changes
Apr 12, 2024
innerdvations
changed the title
fix!: create should send 201 status code
enhancement!: create should send 201 status code
Apr 12, 2024
innerdvations
added
pr: enhancement
This PR adds or updates some part of the codebase or features
and removed
pr: fix
This PR is fixing a bug
labels
Apr 12, 2024
christiancp100
approved these changes
Apr 15, 2024
echoes-hq
bot
added
the
echoes/type: feature/enhancement
For enhancements to existing functionality and tools
label
Apr 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
echoes/type: feature/enhancement
For enhancements to existing functionality and tools
flag: 💥 Breaking change
This PR contains breaking changes and should not be merged
pr: enhancement
This PR adds or updates some part of the codebase or features
source: core:strapi
Source is core/strapi package
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does it do?
All create methods throughout strapi now use ctx.created, most importantly the content api. In cases I wasn't sure it was safe to use ctx.created I explicitly set status to 201
Why is it needed?
Create actions should result in a 201 http status code
How to test it?
All the updated tests test it pretty thoroughly.
But to test manually, the default status for a create action in a custom controller should be 201 so:
Admin API can essentially be tested the same way, just through different endpoints.
Related issue(s)/PR(s)
DX-1118