implement custom payload

This commit is contained in:
marin postma 2021-06-23 13:55:16 +02:00
parent 71226feb74
commit 1c13100948
No known key found for this signature in database
GPG key ID: 6088B7721C3E39F9
4 changed files with 65 additions and 7 deletions

View file

@ -9,7 +9,7 @@ use serde_json::Value;
use crate::error::ResponseError;
use crate::helpers::Authentication;
use crate::routes::IndexParam;
use crate::Data;
use crate::{Data, Payload};
const DEFAULT_RETRIEVE_DOCUMENTS_OFFSET: usize = 0;
const DEFAULT_RETRIEVE_DOCUMENTS_LIMIT: usize = 20;
@ -129,7 +129,7 @@ async fn add_documents(
data: web::Data<Data>,
path: web::Path<IndexParam>,
params: web::Query<UpdateDocumentsQuery>,
body: web::Payload,
body: Payload,
) -> Result<HttpResponse, ResponseError> {
let update_status = data
.add_documents(
@ -173,7 +173,7 @@ async fn update_documents(
data: web::Data<Data>,
path: web::Path<IndexParam>,
params: web::Query<UpdateDocumentsQuery>,
body: web::Payload,
body: Payload,
) -> Result<HttpResponse, ResponseError> {
let update = data
.add_documents(