feat(http): paginate the index resource

Fix #2373
This commit is contained in:
Irevoire 2022-05-24 11:29:03 +02:00 committed by Tamo
parent ab39df9693
commit 627f13df85
No known key found for this signature in database
GPG key ID: 20CD8020AFA88D69
8 changed files with 208 additions and 75 deletions

View file

@ -353,10 +353,10 @@ async fn list_authorized_indexes_restricted_index() {
let key = response["key"].as_str().unwrap();
server.use_api_key(&key);
let (response, code) = server.list_indexes().await;
let (response, code) = server.list_indexes(None, None).await;
assert_eq!(code, 200);
let response = response.as_array().unwrap();
let response = response["results"].as_array().unwrap();
// key should have access on `products` index.
assert!(response.iter().any(|index| index["uid"] == "products"));
@ -394,10 +394,10 @@ async fn list_authorized_indexes_no_index_restriction() {
let key = response["key"].as_str().unwrap();
server.use_api_key(&key);
let (response, code) = server.list_indexes().await;
let (response, code) = server.list_indexes(None, None).await;
assert_eq!(code, 200);
let response = response.as_array().unwrap();
let response = response["results"].as_array().unwrap();
// key should have access on `products` index.
assert!(response.iter().any(|index| index["uid"] == "products"));