Can get the full list of relays through the API
This commit is contained in:
10
central_backend/src/server/web_api/relays_controller.rs
Normal file
10
central_backend/src/server/web_api/relays_controller.rs
Normal file
@ -0,0 +1,10 @@
|
||||
use crate::energy::energy_actor;
|
||||
use crate::server::custom_error::HttpResult;
|
||||
use crate::server::WebEnergyActor;
|
||||
use actix_web::HttpResponse;
|
||||
|
||||
/// Get the full list of relays
|
||||
pub async fn get_list(actor: WebEnergyActor) -> HttpResult {
|
||||
let list = actor.send(energy_actor::GetRelaysList).await?;
|
||||
Ok(HttpResponse::Ok().json(list))
|
||||
}
|
Reference in New Issue
Block a user