refactor(application): remove pass-through search use cases — call SearchPort directly
This commit is contained in:
@@ -4,6 +4,5 @@ pub mod federation_management;
|
||||
pub mod feed;
|
||||
pub mod notifications;
|
||||
pub mod profile;
|
||||
pub mod search;
|
||||
pub mod social;
|
||||
pub mod thoughts;
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
use domain::{
|
||||
errors::DomainError,
|
||||
models::{
|
||||
feed::{FeedEntry, PageParams, Paginated},
|
||||
user::User,
|
||||
},
|
||||
ports::SearchPort,
|
||||
value_objects::UserId,
|
||||
};
|
||||
|
||||
pub async fn search_thoughts(
|
||||
search: &dyn SearchPort,
|
||||
query: &str,
|
||||
page: PageParams,
|
||||
viewer_id: Option<&UserId>,
|
||||
) -> Result<Paginated<FeedEntry>, DomainError> {
|
||||
search.search_thoughts(query, &page, viewer_id).await
|
||||
}
|
||||
|
||||
pub async fn search_users(
|
||||
search: &dyn SearchPort,
|
||||
query: &str,
|
||||
page: PageParams,
|
||||
) -> Result<Paginated<User>, DomainError> {
|
||||
search.search_users(query, &page).await
|
||||
}
|
||||
Reference in New Issue
Block a user