get count

This commit is contained in:
filipriec
2025-02-21 22:41:46 +01:00
parent 577492b03c
commit 4a2b5d0c12
5 changed files with 37 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ use tonic_reflection::server::Builder as ReflectionBuilder;
use crate::adresar::handlers::{
post_adresar, get_adresar, put_adresar, delete_adresar, get_adresar_count, get_adresar_by_position, get_table_structure
};
use crate::uctovnictvo::handlers::{post_uctovnictvo, get_uctovnictvo}; // Update this line
use crate::uctovnictvo::handlers::{post_uctovnictvo, get_uctovnictvo, get_uctovnictvo_count};
use crate::proto::multieko2::{
FILE_DESCRIPTOR_SET,
};
@@ -104,6 +104,14 @@ impl Uctovnictvo for UctovnictvoService {
let response = get_uctovnictvo(&self.db_pool, request.into_inner()).await?;
Ok(Response::new(response))
}
async fn get_uctovnictvo_count(
&self,
request: Request<Empty>,
) -> Result<Response<CountResponse>, Status> {
let response = get_uctovnictvo_count(&self.db_pool, request.into_inner()).await?;
Ok(Response::new(response))
}
}
pub async fn run_server(db_pool: sqlx::PgPool) -> Result<(), Box<dyn std::error::Error>> {