diff options
Diffstat (limited to 'backend')
-rw-r--r-- | backend/src/handlers/rating.rs | 7 | ||||
-rw-r--r-- | backend/src/handlers/transaction.rs | 3 |
2 files changed, 3 insertions, 7 deletions
diff --git a/backend/src/handlers/rating.rs b/backend/src/handlers/rating.rs index dfbeb3e..3b8265e 100644 --- a/backend/src/handlers/rating.rs +++ b/backend/src/handlers/rating.rs | |||
@@ -82,10 +82,3 @@ pub async fn remove_rating( | |||
82 | .body("Need to be logged in to add to cart!"); | 82 | .body("Need to be logged in to add to cart!"); |
83 | } | 83 | } |
84 | } | 84 | } |
85 | |||
86 | // pub async fn get_product_reviews( | ||
87 | // product: web::Json<GetProductReviews>, | ||
88 | // pool: web::Data<TPool>, | ||
89 | // ) -> impl Responder { | ||
90 | // unimplemented!() | ||
91 | // } | ||
diff --git a/backend/src/handlers/transaction.rs b/backend/src/handlers/transaction.rs index 1e87312..c04f239 100644 --- a/backend/src/handlers/transaction.rs +++ b/backend/src/handlers/transaction.rs | |||
@@ -45,6 +45,9 @@ pub async fn checkout_cart( | |||
45 | .values(transaction_entry) | 45 | .values(transaction_entry) |
46 | .execute(&conn) | 46 | .execute(&conn) |
47 | .expect("Coundn't connect to DB"); | 47 | .expect("Coundn't connect to DB"); |
48 | diesel::delete(cart_items.filter(cart_id.eq(selected_user.id))) | ||
49 | .execute(&conn) | ||
50 | .expect("Coundn't connect to DB"); | ||
48 | return HttpResponse::Ok().body("Transaction performed successfully"); | 51 | return HttpResponse::Ok().body("Transaction performed successfully"); |
49 | } else { | 52 | } else { |
50 | return HttpResponse::Unauthorized().body("Login first"); | 53 | return HttpResponse::Unauthorized().body("Login first"); |