use crate::bootstrap::state::AppState;
use crate::features::wizard;
use shared::Response as RpResponse;
use shared::WizardCreateReq;
pub async fn catalog(search: String) -> RpResponse {
RpResponse::WizardCatalog {
dbs: wizard::db_rows_json(),
brokers: wizard::broker_rows_json(),
templates: wizard::templates_catalog_json(&search),
}
}
pub async fn create(state: AppState, req: WizardCreateReq) -> RpResponse {
match wizard::build_spec(&req) {
Ok(spec) => crate::features::services::create::handle(state, spec).await,
Err(e) => RpResponse::err("WizardError", e),
}
}