Add AppState to Controller and split up models
This commit is contained in:
parent
8dc9072fe8
commit
83c1f033d5
11 changed files with 261 additions and 150 deletions
emgauwa-controller/src
9
emgauwa-controller/src/utils.rs
Normal file
9
emgauwa-controller/src/utils.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
use actix::Addr;
|
||||
use emgauwa_lib::errors::EmgauwaError;
|
||||
use emgauwa_lib::models::Controller;
|
||||
|
||||
use crate::app_state::{AppState, GetThis};
|
||||
|
||||
pub async fn get_this(app_state: &Addr<AppState>) -> Result<Controller, EmgauwaError> {
|
||||
app_state.send(GetThis {}).await.map_err(EmgauwaError::from)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue