async fn delete(
    db: Data<PgPool>,
    auth: TokenUser,
    path: web::Path<JigId>,
    req: Json<<module::Update as ApiEndpoint>::Req>,
) -> Result<HttpResponse, error::Delete> {
    let parent_id = path.into_inner();

    db::jig::authz(&*db, auth.0.user_id, Some(parent_id)).await?;

    db::jig::module::delete(&*db, parent_id, req.id).await?;

    Ok(HttpResponse::NoContent().finish())
}
/// Delete a module from a draft JIG.
Delete a module from a draft JIG.
Delete a module from a draft JIG .
async fn delete(
    db: Data<PgPool>,
    auth: TokenUser,
    path: web::Path<JigId>,
    req: Json<<module::Update as ApiEndpoint>::Req>,
) -> Result<HttpResponse, error::Delete> {
    let parent_id = path.into_inner();
    db::jig::authz(&*db, auth.0.user_id, Some(parent_id)).await?;
    db::jig::module::delete(&*db, parent_id, req.id).await?;
    Ok(HttpResponse::NoContent().finish())
}
async fn delete ( db : Data < PgPool > , auth : TokenUser , path : web :: Path < JigId > , req : Json < < module :: Update as ApiEndpoint > :: Req > , ) -> Result < HttpResponse , error :: Delete > { let parent_id = path . into_inner ( ) ; db :: jig :: authz ( & * db , auth . 0 . user_id , Some ( parent_id ) ) . await ? ; db :: jig :: module :: delete ( & * db , parent_id , req . id ) . await ? ; Ok ( HttpResponse :: NoContent ( ) . finish ( ) ) }
Delete a module from a draft JIG.
Delete a module from a draft JIG .
db
Data<PgPool>
auth
TokenUser
path
web::Path<JigId>
req
Json<<module::Update as ApiEndpoint>::Req>
db
Data<PgPool>
auth
TokenUser
path
web::Path<JigId>
req
Json<<module::Update as ApiEndpoint>::Req>