diff --git a/src/controllers/likes_controller.rs b/src/controllers/likes_controller.rs index a56862c..37b36ca 100644 --- a/src/controllers/likes_controller.rs +++ b/src/controllers/likes_controller.rs @@ -39,6 +39,12 @@ pub fn update(r: &mut HttpRequestHandler) -> RequestResult { LikeTarget(post.id, LikeType::POST) } + // In case of comment + "comment" => { + let comment = r.post_comment_with_access("id")?; + LikeTarget(comment.id, LikeType::COMMENT) + } + _ => { r.internal_error(ExecError::boxed_new("Unsupported like type!"))?; unreachable!();