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

pub async fn get_collection(
    db: Connection<PgDb>,
    auth: Auth,
    page: Option<usize>
) -> (Status, Result<Json<Vec<UserGetCollectionResponse>>, Json<ErrorResponse>>)
Expand description

Get Collection

Show posts in user’s collection.

Parameters

  • Auth: Authenticated user
  • Connection<PgDb>: Postgres connection
  • Option<usize>: page number, default value 0

Returns

  • Status: HTTP status
  • Json<Vec<UserGetCollectionResponse>>: Json of Vec, including struct Post, a bool showing if the posts in collection are updated.

Errors

  • ErrorResponse: Error message
    • ErrorCode::DatabaseErr