use actix_web::{get, web, Responder};
use sqlx::PgPool;
use crate::api::get_count;
#[utoipa::path(
get,
path = "/api/v1/transactions/count",
responses(
(status = 200, description = "Successfully retrieved the transaction count"),
(status = 500, description = "Internal Server Error")
)
)]
#[get("/count")]
pub async fn get_transactions_count(conn: web::Data<PgPool>) -> impl Responder {
match get_count(conn, "transaction", "Internal server error").await {
Ok(response) => response,
Err(response) => response,
}
}