rename update fields to camel case

This commit is contained in:
mpostma 2021-02-18 17:48:37 +01:00
parent a7bd0681a0
commit 588add8bec
No known key found for this signature in database
GPG key ID: CBC8A7C1D7A28C3A
6 changed files with 19 additions and 19 deletions

View file

@ -52,7 +52,7 @@ async fn get_index(
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
struct IndexCreateRequest {
name: String,
uid: String,
primary_key: Option<String>,
}
@ -61,7 +61,7 @@ async fn create_index(
data: web::Data<Data>,
body: web::Json<IndexCreateRequest>,
) -> Result<HttpResponse, ResponseError> {
match data.create_index(&body.name, body.primary_key.clone()) {
match data.create_index(&body.uid, body.primary_key.clone()) {
Ok(meta) => {
let json = serde_json::to_string(&meta).unwrap();
Ok(HttpResponse::Ok().body(json))