Can get the list of movements of an account

This commit is contained in:
2025-04-19 21:45:40 +02:00
parent 08538c3911
commit 811e885bf3
3 changed files with 21 additions and 3 deletions

View File

@ -1,4 +1,5 @@
use crate::controllers::HttpResult;
use crate::extractors::account_extractor::AccountInPath;
use crate::extractors::auth_extractor::AuthExtractor;
use crate::services::movements_service;
use crate::services::movements_service::UpdateMovementQuery;
@ -14,3 +15,9 @@ pub async fn create(auth: AuthExtractor, req: web::Json<UpdateMovementQuery>) ->
Ok(HttpResponse::Created().finish())
}
/// Get the list of movements of an account
pub async fn get_list_of_account(account_id: AccountInPath) -> HttpResult {
Ok(HttpResponse::Ok()
.json(movements_service::get_list_account(account_id.as_ref().id()).await?))
}