diff options
author | Akshay <[email protected]> | 2020-12-16 16:43:09 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2020-12-16 16:43:09 +0000 |
commit | 41dcd48b71e7f5a8df79d6b0871a2bf95b7aa80e (patch) | |
tree | 671823706d7a6eafdc18191aed29b4a5945a04b0 /src | |
parent | 2a112855e54ea3a365fa032e8726196a7eec9a06 (diff) |
extend deps to chrono + serde
Diffstat (limited to 'src')
-rw-r--r-- | src/handlers/cart_items.rs | 3 | ||||
-rw-r--r-- | src/handlers/mod.rs | 1 |
2 files changed, 2 insertions, 2 deletions
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( | |||
102 | .expect("Couldn't connect to db") | 102 | .expect("Couldn't connect to db") |
103 | }) | 103 | }) |
104 | .collect::<Vec<_>>(); | 104 | .collect::<Vec<_>>(); |
105 | return HttpResponse::Ok() | 105 | return HttpResponse::Ok().json(&cart_products); |
106 | .body(serde_json::to_string(&cart_products).unwrap()); | ||
107 | } else { | 106 | } else { |
108 | return HttpResponse::Unauthorized() | 107 | return HttpResponse::Unauthorized() |
109 | .body("Need to be logged in to add to cart!"); | 108 | .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 @@ | |||
1 | pub mod cart_items; | 1 | pub mod cart_items; |
2 | pub mod product; | 2 | pub mod product; |
3 | pub mod rating; | ||
3 | pub mod smoke; | 4 | pub mod smoke; |
4 | pub mod users; | 5 | pub mod users; |