Skip to main content

create_comment

Function create_comment 

Source
pub async fn create_comment(
    post_id: i32,
    parent_id: Option<i64>,
    author_name: String,
    author_email: String,
    author_url: Option<String>,
    content_md: String,
    honeypot: String,
) -> Result<CommentResponse, ServerFnError>
Expand description

创建一条新评论。

对作者昵称、邮箱、网址与内容进行基础校验; 若目标文章未发布或父评论未通过审核,则拒绝提交; 成功后将评论置为 pending,并清空相关缓存。

§Handler information

  • Method: post
  • Path: <auto>