From ada9d04c6546b769f1dece47e1c26bc49eb10d90 Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 14 Aug 2023 08:54:36 +0800 Subject: [PATCH] Greenmiles points --- client/tproject/src/pages/rider/ViewSpecificRequest.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/tproject/src/pages/rider/ViewSpecificRequest.jsx b/client/tproject/src/pages/rider/ViewSpecificRequest.jsx index 8715ff3..e654931 100644 --- a/client/tproject/src/pages/rider/ViewSpecificRequest.jsx +++ b/client/tproject/src/pages/rider/ViewSpecificRequest.jsx @@ -113,10 +113,12 @@ const RideRequestDetails = () => { .then(() => { // Deduct the finalPrice from the user's cash attribute const updatedCash = user.cash - finalPrice; + const greenMiles = user.points + (finalPrice / 100).toFixed() // Update the user's cash attribute return http.put(`/riderequests/minuscash/user/${rideRequest.userId}`, { cash: updatedCash, + points: greenMiles }); }) .then(() => {