implement list indexes

This commit is contained in:
mpostma 2021-03-06 20:12:20 +01:00
parent d9254c4355
commit 281a445998
No known key found for this signature in database
GPG key ID: CBC8A7C1D7A28C3A
5 changed files with 95 additions and 29 deletions

View file

@ -21,7 +21,7 @@ pub fn services(cfg: &mut web::ServiceConfig) {
#[get("/indexes", wrap = "Authentication::Private")]
async fn list_indexes(data: web::Data<Data>) -> Result<HttpResponse, ResponseError> {
match data.list_indexes() {
match data.list_indexes().await {
Ok(indexes) => {
let json = serde_json::to_string(&indexes).unwrap();
Ok(HttpResponse::Ok().body(&json))