mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-24 00:39:32 +09:00
[API] Fix: Validate id
This commit is contained in:
parent
e31eec542f
commit
2cc2ecb13c
@ -28,6 +28,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)
|
||||
|
Loading…
Reference in New Issue
Block a user