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

Bugfix: Expect 201 upon a successful ArticleAPI.create call #42

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

Conversation

iacobus
Copy link

@iacobus iacobus commented May 9, 2023

201 is the standard HTTP status response code when successfully creating a resource. Backend frameworks like NestJS return 201 when responding to POST requests (https://docs.nestjs.com/controllers#status-code).

Bug reproduction

I came across this issue with vanilla installations of this repo (from commit be9ef56) as frontend, and of the NestJS+MikroORM repo (commit 827cee98b3b6078d26860b5251b3587e29de6484) as backend.

Then, simply create an Article using the UI to land in the if clause in the modified code, which triggers setErrors without an error having occurred.

Fix
Backend reasonably fires 201 upon success, so expect a 201.

201 is the standard HTTP status response code when successfully creating a resource. Backend frameworks like NestJS return 201 when responding to POST requests (https://docs.nestjs.com/controllers#status-code).
@vercel
Copy link

vercel bot commented May 9, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-realworld-example-app ❌ Failed (Inspect) May 9, 2023 4:55pm

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

Successfully merging this pull request may close these issues.

None yet

1 participant