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

reduce if/else #173

Open
cubap opened this issue May 21, 2024 · 1 comment
Open

reduce if/else #173

cubap opened this issue May 21, 2024 · 1 comment
Assignees

Comments

@cubap
Copy link
Member

cubap commented May 21, 2024

return instead of else

if (rest.checkPatchOverrideSupport(req, res)) {
controller.patchSet(req, res, next)
}
else {
res.statusMessage = 'Improper request method for updating, please use PATCH to add new keys to this object.'
res.status(405)
next()
}

@cubap
Copy link
Member Author

cubap commented May 21, 2024

alternately, consider moving checking patch override support to middleware

@cubap cubap self-assigned this Nov 25, 2024
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

No branches or pull requests

1 participant