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

pub async fn create_post(
    auth: Auth,
    db: Connection<PgDb>,
    post_info: Json<PostInfo>,
    producer: Connection<PulsarMq>
) -> (Status, Result<Json<PostCreateResponse>, Json<ErrorResponse>>)
Expand description

Create Post

Parameters

  • Auth: Authenticated user
  • Connection<PgDb>: Postgres connection
  • Json<PostInfo>: Post information
  • Connection<PulsarMq>: Pulsar connection

Returns

  • Status: HTTP status
  • PostCreateResponse: Response of create post

Errors

  • ErrorResponse: Error message
    • ErrorCode::EmptyField
    • ErrorCode::SectionInvalid
    • ErrorCode::UserNotExist
    • ErrorCode::UserForbidden
    • ErrorCode::BurrowInvalid
    • ErrorCode::DatabaseErr