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