diff options
Diffstat (limited to 'src/handlers/cart_items.rs')
-rw-r--r-- | src/handlers/cart_items.rs | 3 |
1 files changed, 1 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!"); |