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)
}