fix for review

This commit is contained in:
qdequele 2020-01-29 18:30:21 +01:00
parent 14b5fc4d6c
commit a5b0e468ee
No known key found for this signature in database
GPG key ID: B3F0A000EBF11745
48 changed files with 558 additions and 1216 deletions

View file

@ -55,7 +55,7 @@ pub async fn list_indexes(ctx: Request<Data>) -> SResult<Response> {
}
}
Ok(tide::Response::new(200).body_json(&response_body).unwrap())
Ok(tide::Response::new(200).body_json(&response_body)?)
}
#[derive(Debug, Serialize)]
@ -87,7 +87,7 @@ pub async fn get_index(ctx: Request<Data>) -> SResult<Response> {
updated_at,
};
Ok(tide::Response::new(200).body_json(&response_body).unwrap())
Ok(tide::Response::new(200).body_json(&response_body)?)
}
#[derive(Debug, Deserialize)]
@ -95,7 +95,7 @@ pub async fn get_index(ctx: Request<Data>) -> SResult<Response> {
struct IndexCreateRequest {
name: Option<String>,
uid: Option<String>,
attribute_identifier: Option<String>,
identifier: Option<String>,
}
#[derive(Debug, Serialize)]
@ -150,10 +150,10 @@ pub async fn create_index(mut ctx: Request<Data>) -> SResult<Response> {
.updated_at(&writer)?
.into_internal_error()?;
if let Some(id) = body.attribute_identifier {
if let Some(id) = body.identifier {
created_index
.main
.put_schema(&mut writer, &Schema::with_identifier(id))?;
.put_schema(&mut writer, &Schema::with_identifier(&id))?;
}
writer.commit()?;
@ -165,7 +165,7 @@ pub async fn create_index(mut ctx: Request<Data>) -> SResult<Response> {
updated_at,
};
Ok(tide::Response::new(201).body_json(&response_body).unwrap())
Ok(tide::Response::new(201).body_json(&response_body)?)
}
#[derive(Debug, Deserialize)]
@ -214,7 +214,7 @@ pub async fn update_index(mut ctx: Request<Data>) -> SResult<Response> {
updated_at,
};
Ok(tide::Response::new(200).body_json(&response_body).unwrap())
Ok(tide::Response::new(200).body_json(&response_body)?)
}
pub async fn get_update_status(ctx: Request<Data>) -> SResult<Response> {