Skip to content
Snippets Groups Projects
Commit 1c9ec601 authored by syuilo's avatar syuilo
Browse files

[API] Fix: Validate id

parent 4ad04f5b
No related merge requests found
......@@ -25,6 +25,11 @@ module.exports = (params, user) =>
return rej('post_id is required');
}
// Validate id
if (!mongo.ObjectID.isValid(postId)) {
return rej('incorrect post_id');
}
// Get likee
const post = await Post.findOne({
_id: new mongo.ObjectID(postId)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment