Function backend::routes::content::read_post[][src]

pub async fn read_post(
    auth: Auth,
    db: Connection<PgDb>,
    post_id: i64,
    page: Option<usize>
) -> (Status, Result<Json<PostPage>, Json<ErrorResponse>>)
Expand description

Read a Specific Post

Parameters

  • Auth: Authenticated user
  • Connection<PgDb>: Postgres connection
  • i64: Post id
  • Option<usize>: Page number for post

Returns

  • Status: HTTP status
  • PostPage: Post detail information, including post and up to 10 replies

Errors

  • ErrorResponse: Error message
    • ErrorCode::PostNotExist
    • ErrorCode::DatabaseErr