BLOG-56 refactor: remove adoundence Arc
Some checks failed
Frontend CI / build (push) Successful in 1m28s
PR Title Check / pr-title-check (pull_request) Failing after 16s

This commit is contained in:
Yu Squire[ Yu, Tsung-Ying ] 2025-07-01 12:28:25 +08:00
parent 9dcefe90c5
commit 1dc8ca742b
2 changed files with 3 additions and 5 deletions

View File

@ -1,5 +1,3 @@
use std::sync::Arc;
use actix_web::{HttpResponse, Responder, web};
use crate::{
@ -16,7 +14,7 @@ pub fn configure_post_routes(cfg: &mut web::ServiceConfig) {
}
async fn get_all_post_info_handler(
post_controller: web::Data<Arc<dyn PostController>>,
post_controller: web::Data<dyn PostController>,
query: web::Query<PostQueryDto>,
) -> impl Responder {
let is_published_only = query.is_published_only.unwrap_or_else(|| true);
@ -32,7 +30,7 @@ async fn get_all_post_info_handler(
}
async fn get_full_post_handler(
post_controller: web::Data<Arc<dyn PostController>>,
post_controller: web::Data<dyn PostController>,
path: web::Path<i32>,
) -> impl Responder {
let id = path.into_inner();

View File

@ -55,6 +55,6 @@ fn create_app(
App::new()
.app_data(web::Data::new(db_pool))
.app_data(web::Data::new(container.post_controller))
.app_data(web::Data::from(container.post_controller))
.configure(configure_post_routes)
}