pub async fn list_items(pool: web::Data<DbPool>) -> ActixResult<HttpResponse, Error> {
    let conn = pool.get().unwrap();

    let items = web::block(move || list_items_impl(&conn))
        .await
        .map_err(|e| {
            log::error!("{:?}", e);
            HttpResponse::InternalServerError().finish()
        })?;

    HttpResponse::Ok().json(items).await
}
/// Get a list of all items
Get a list of all items
Get a list of all items
pub async fn list_items(pool: web::Data<DbPool>) -> ActixResult<HttpResponse, Error> {
    let conn = pool.get().unwrap();
    let items = web::block(move || list_items_impl(&conn))
        .await
        .map_err(|e| {
            log::error!("{:?}", e);
            HttpResponse::InternalServerError().finish()
        })?;
    HttpResponse::Ok().json(items).await
}
pub async fn list_items ( pool : web :: Data < DbPool > ) -> ActixResult < HttpResponse , Error > { let conn = pool . get ( ) . unwrap ( ) ; let items = web :: block ( move | | list_items_impl ( & conn ) ) . await . map_err ( | e | { log :: error ! ( " " e ) ; HttpResponse :: InternalServerError ( ) . finish ( ) } ) ? ; HttpResponse :: Ok ( ) . json ( items ) . await }
Get a list of all items
Get a list of all items
pool
web::Data<DbPool>