Actors are global

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Lee Smet
2025-08-29 10:29:32 +02:00
parent 9c47eaaf93
commit 2aa6277385
5 changed files with 30 additions and 26 deletions

View File

@@ -315,12 +315,10 @@ impl MessageCreate {
#[derive(Debug, Deserialize)]
pub struct ActorCreateParams {
pub context_id: u32,
pub actor: ActorCreate,
}
#[derive(Debug, Deserialize)]
pub struct ActorLoadParams {
pub context_id: u32,
pub id: u32,
}
@@ -397,7 +395,7 @@ pub fn build_module(state: Arc<AppState>) -> RpcModule<()> {
let actor = p.actor.into_domain().map_err(invalid_params_err)?;
let actor = state
.service
.create_actor(p.context_id, actor)
.create_actor(actor)
.await
.map_err(storage_err)?;
Ok::<_, ErrorObjectOwned>(actor)
@@ -414,7 +412,7 @@ pub fn build_module(state: Arc<AppState>) -> RpcModule<()> {
let p: ActorLoadParams = params.parse().map_err(invalid_params_err)?;
let actor = state
.service
.load_actor(p.context_id, p.id)
.load_actor(p.id)
.await
.map_err(storage_err)?;
Ok::<_, ErrorObjectOwned>(actor)