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

pub async fn read_post_list(
    auth: Auth,
    db: Connection<PgDb>,
    page: Option<usize>,
    section: Vec<String>,
    conn: Connection<TypesenseSearch>
) -> (Status, Result<Json<ListPage>, Json<ErrorResponse>>)
Expand description

Read a List of Posts with Number Up to Ten

Parameters

  • Auth: Authenticated user
  • Connection<PgDb>: Postgres connection
  • Option<usize>: Page number for post
  • Vec<String>: Section of Post
  • Connection<TypesenseSearch>: Typesense connection

Returns

  • Status: HTTP status
  • ListPage: A List of post information

Errors

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