aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/handlers/cart_items.rs3
-rw-r--r--src/handlers/mod.rs1
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 @@
1pub mod cart_items; 1pub mod cart_items;
2pub mod product; 2pub mod product;
3pub mod rating;
3pub mod smoke; 4pub mod smoke;
4pub mod users; 5pub mod users;