From 640b6f0e4dd4064d093fca7e1445947c668e66e6 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Mon, 2 Sep 2024 19:56:12 +0100 Subject: [PATCH] Updated the user card to allow master corporate to edit without setting a price --- src/components/UserCard.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/UserCard.tsx b/src/components/UserCard.tsx index fa145db3..977af621 100644 --- a/src/components/UserCard.tsx +++ b/src/components/UserCard.tsx @@ -143,7 +143,11 @@ const UserCard = ({ }, [users, referralAgent]); const updateUser = () => { - if ((user.type === "corporate" || user.type === "mastercorporate") && (!paymentValue || paymentValue < 0)) + if ( + (user.type === "corporate" || user.type === "mastercorporate") && + (!paymentValue || paymentValue < 0) && + ["admin", "developer"].includes(loggedInUser.type) + ) return toast.error("Please set a price for the user's package before updating!"); if (!confirm(`Are you sure you want to update ${user.name}'s account?`)) return;