diff options
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; |