From 41dcd48b71e7f5a8df79d6b0871a2bf95b7aa80e Mon Sep 17 00:00:00 2001 From: Akshay Date: Wed, 16 Dec 2020 22:13:09 +0530 Subject: extend deps to chrono + serde --- src/handlers/cart_items.rs | 3 +-- src/handlers/mod.rs | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/handlers') diff --git a/src/handlers/cart_items.rs b/src/handlers/cart_items.rs index 62cab75..2ad800b 100644 --- a/src/handlers/cart_items.rs +++ b/src/handlers/cart_items.rs @@ -102,8 +102,7 @@ pub async fn get_user_cart_items( .expect("Couldn't connect to db") }) .collect::>(); - return HttpResponse::Ok() - .body(serde_json::to_string(&cart_products).unwrap()); + return HttpResponse::Ok().json(&cart_products); } else { return HttpResponse::Unauthorized() .body("Need to be logged in to add to cart!"); diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs index 28591bc..9416857 100644 --- a/src/handlers/mod.rs +++ b/src/handlers/mod.rs @@ -1,4 +1,5 @@ pub mod cart_items; pub mod product; +pub mod rating; pub mod smoke; pub mod users; -- cgit v1.2.3