Hashnode / Hashnode/mern-starter

Code execution continues when it should stop in POST action

Open
#407 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.1k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Hello.
If you try to post empty data via API, not React client application, the application will crash. The particular line in problem is in post.controller.js file, where you check if name, title or content are empty. The line:

`res.status(403).end();`

should abort execution. Possible solution could be:

`return res.status(403).end();`

but it raises eslint consistent-return warning.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.