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

Refactor comments API routes and add GET and DELETE routes for comments #22

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

OnFreund
Copy link
Collaborator

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Copy link

wilcoapp bot commented Apr 23, 2024

On it, I'll review the changes right away.

Copy link

@wilcoapp wilcoapp bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! You've made the necessary changes. You can now merge the PR.

Comment on lines +22 to +28
router.get("/", (req, res) => {
Comment.find()
.then(comments => {
res.json({ comments });
})
.catch(err => console.log(err));
});

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
a database access
, but is not rate-limited.
Comment on lines +40 to +47
router.delete("/:id", async (req, res) => {
try {
await Comment.findByIdAndRemove(req.params.id);
res.json({ success: true });
} catch (err) {
console.log(err);
}
});

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
a database access
, but is not rate-limited.
@OnFreund OnFreund merged commit cfcc409 into main Apr 23, 2024
2 of 3 checks passed
@OnFreund OnFreund deleted the copilot branch April 23, 2024 13:19
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.

1 participant