mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-22 12:21:18 +00:00
parent
f4d33389a5
commit
a0d5987502
1 changed files with 2 additions and 2 deletions
|
@ -70,10 +70,10 @@ impl Perform for CreateComment {
|
||||||
let parent =
|
let parent =
|
||||||
match blocking(context.pool(), move |conn| Comment::read(&conn, parent_id)).await? {
|
match blocking(context.pool(), move |conn| Comment::read(&conn, parent_id)).await? {
|
||||||
Ok(comment) => comment,
|
Ok(comment) => comment,
|
||||||
Err(_e) => return Err(APIError::err("couldnt_create_comment").into()),
|
Err(_e) => return Err(APIError::err("couldnt_find_parent_comment").into()),
|
||||||
};
|
};
|
||||||
if parent.post_id != post_id {
|
if parent.post_id != post_id {
|
||||||
return Err(APIError::err("couldnt_create_comment").into());
|
return Err(APIError::err("parent_comment_not_in_post").into());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue