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 userConnection<PgDb>
: Postgres connectionJson<PostInfo>
: Post informationConnection<PulsarMq>
: Pulsar connection
Returns
Status
: HTTP statusPostCreateResponse
: Response of create post
Errors
ErrorResponse
: Error messageErrorCode::EmptyField
ErrorCode::SectionInvalid
ErrorCode::UserNotExist
ErrorCode::UserForbidden
ErrorCode::BurrowInvalid
ErrorCode::DatabaseErr