diff --git a/src/services/member/service.rs b/src/services/member/service.rs index 0e3f893..b9d5323 100644 --- a/src/services/member/service.rs +++ b/src/services/member/service.rs @@ -397,7 +397,28 @@ impl Service<'_> { bpr::ss::member::CreateMemberResponse { error: None, result: Some(bpr::ss::member::create_member_response::Result { - member: member.map(|d| bpr::models::member::MemberModel::from(&d)), + member: member.as_ref().map(bpr::models::member::MemberModel::from), + }), + } + .encode_to_vec(), + ) + .await + .map_err(|e| { + bcr::error::rpc::Error::Server(bcr::error::rpc::Server { + code: bpr::protobuf::rpc::Error::SERVER_00, + message: format!("server {}", e), + data: None, + }) + })?; + + self + .connection_broker + .publish( + bpr::ss::member::EVENT_SUBJECT_AFTER_CREATE_MEMBER, + bpr::ss::member::AfterCreateMemberEvent { + client: Some(client), + event: Some(bpr::ss::member::after_create_member_event::Event { + member: member.as_ref().map(bpr::models::member::MemberModel::from), }), } .encode_to_vec(),