feat(ap): broadcast Update(Actor) when user updates their profile
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
use domain::{
|
||||
errors::DomainError,
|
||||
events::DomainEvent,
|
||||
models::{top_friend::TopFriend, user::User},
|
||||
ports::{TopFriendRepository, UserRepository},
|
||||
ports::{EventPublisher, TopFriendRepository, UserRepository},
|
||||
value_objects::{UserId, Username},
|
||||
};
|
||||
|
||||
@@ -38,8 +39,10 @@ pub async fn get_user_by_id_or_username(
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub async fn update_profile(
|
||||
users: &dyn UserRepository,
|
||||
events: &dyn EventPublisher,
|
||||
user_id: &UserId,
|
||||
display_name: Option<String>,
|
||||
bio: Option<String>,
|
||||
@@ -56,6 +59,11 @@ pub async fn update_profile(
|
||||
header_url,
|
||||
custom_css,
|
||||
)
|
||||
.await?;
|
||||
events
|
||||
.publish(&DomainEvent::ProfileUpdated {
|
||||
user_id: user_id.clone(),
|
||||
})
|
||||
.await
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user