not-decky-store/src/not_decky/plugins.rs

15 lines
535 B
Rust
Raw Normal View History

2022-12-08 02:30:10 +00:00
use decky_api::StorePluginList;
use actix_web::{get, web, Responder};
use crate::storage::IStorage;
2022-12-08 02:30:10 +00:00
#[get("/plugins")]
pub async fn decky_plugins(req: actix_web::HttpRequest, data: actix_web::web::Data<Box<dyn IStorage>>) -> impl Responder {
let query_string = req.query_string().to_owned();
log::debug!("Got request with uri {}", req.uri());
let plugins: StorePluginList = web::block(move || data.plugins(&query_string)).await.unwrap();
log::debug!("Got {} plugin results", plugins.len());
web::Json(plugins)
2022-12-08 02:30:10 +00:00
}