From addbf7d1a3ceb8d3164fc7745daed0affde78804 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 27 Dec 2020 12:39:17 +0530 Subject: finishing touches to transaction api --- backend/src/handlers/transaction.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'backend/src/handlers/transaction.rs') 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( .values(transaction_entry) .execute(&conn) .expect("Coundn't connect to DB"); + diesel::delete(cart_items.filter(cart_id.eq(selected_user.id))) + .execute(&conn) + .expect("Coundn't connect to DB"); return HttpResponse::Ok().body("Transaction performed successfully"); } else { return HttpResponse::Unauthorized().body("Login first"); -- cgit v1.2.3