From d3a28fde46bb06f084c74904fa8849b40e5f8c87 Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Thu, 8 Oct 2020 21:56:57 -0400 Subject: refactored image_api into NewProductImageData and NewProductImages, ready for repo --- dichroism/src/handlers.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'dichroism/src/handlers.rs') diff --git a/dichroism/src/handlers.rs b/dichroism/src/handlers.rs index 0e2b2c3..f8f10d3 100644 --- a/dichroism/src/handlers.rs +++ b/dichroism/src/handlers.rs @@ -25,17 +25,17 @@ async fn get_images(pool: web::Data) -> Result { #[post("/images")] async fn create_image(_config: web::Data, req_body: String) -> impl Responder { - let data = match image_api::extract_data(&req_body) { - Err(e) => return HttpResponse::BadRequest().body(format!("fail: {}", e.to_string())), - Ok(d) => d, - }; + // let data = match image_api::extract_data(&req_body) { + // Err(e) => return HttpResponse::BadRequest().body(format!("fail: {}", e.to_string())), + // Ok(d) => d, + // }; - if let Err(e) = image_api::generate_images(data) { - return HttpResponse::BadRequest().body(format!( - "Unable to extract image from data URI: {}", - e.to_string() - )); - } + // if let Err(e) = image_api::generate_images(data) { + // return HttpResponse::BadRequest().body(format!( + // "Unable to extract image from data URI: {}", + // e.to_string() + // )); + // } HttpResponse::Ok().body("Image created.") } -- cgit v1.2.3