Function backend::routes::user::get_burrow[][src]

pub async fn get_burrow(
    db: Connection<PgDb>,
    auth: Auth
) -> (Status, Result<Json<Vec<BurrowMetadata>>, Json<ErrorResponse>>)
Expand description

Get Burrow

Show burrows that belongs to current user, discarded burrows won’t be shown here.

Parameters

  • Auth: Authenticated user
  • Connection<PgDb>: Postgres connection

Returns

  • Status: HTTP status
  • Json<Vec<BurrowMetadata>>: Json of Vec, including id, title, description, amount-of-post of selected burrows

Errors

  • ErrorResponse: Error message
    • ErrorCode::UserNotExist
    • ErrorCode::DatabaseErr