From b063d663fbcecdb3ba88be27279405df34aeb402 Mon Sep 17 00:00:00 2001 From: Priyatham-sai-chand Date: Wed, 24 Mar 2021 08:35:53 +0530 Subject: [PATCH] pricing update to db --- src/components/PricingPlan.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/PricingPlan.js b/src/components/PricingPlan.js index 16aea0b..9b6f63f 100644 --- a/src/components/PricingPlan.js +++ b/src/components/PricingPlan.js @@ -209,11 +209,13 @@ const [ purchased, setPurchased ] = useState(false); const submit = async (props) => { props.preventDefault(); try { + const id = userData.user.id; const pricingRes = await Axios.put( "http://localhost:5000/users/update", { - userData.user.email, - pricing - } + id, + pricing + + } ); } catch (err) { @@ -315,10 +317,12 @@ const submit = async (props) => { ): ( + user name: {userData.user.username} -

Plan selected : {pricing}

+ Plan selected : {pricing} +
) }