From af74c40b3c59ae614781c500e1bf6848ccad647a Mon Sep 17 00:00:00 2001 From: Nadun Sanjeevana <108867149+NadunSanjeevana@users.noreply.github.com> Date: Wed, 13 Sep 2023 00:17:24 +0530 Subject: [PATCH] bug fixed --- src/layouts/authentication/sign-in/index.js | 4 +++- src/layouts/dashboard/index.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/layouts/authentication/sign-in/index.js b/src/layouts/authentication/sign-in/index.js index bff917a..1c235ff 100644 --- a/src/layouts/authentication/sign-in/index.js +++ b/src/layouts/authentication/sign-in/index.js @@ -44,6 +44,7 @@ function Basic() { const { login } = useUser(); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); + const [role, setRole] = useState("user"); const [rememberMe, setRememberMe] = useState(false); @@ -123,11 +124,12 @@ function Basic() { if (data && data.user) { // Display a success message if applicable const userData = data.user; + setRole(userData.role); console.log(userData); login({ name: userData.User_Name, full_name: userData.Full_Name, - role: "user", + role: role, email: userData.email, phone_Number: userData.Contact_Number, profession: userData.Profession, diff --git a/src/layouts/dashboard/index.js b/src/layouts/dashboard/index.js index 9001d59..10a8dbc 100644 --- a/src/layouts/dashboard/index.js +++ b/src/layouts/dashboard/index.js @@ -72,7 +72,7 @@ function Dashboard() { color="success" icon="store" title="Reports" - count="34k" + count={counts.report_count} percentage={{ color: "success", amount: "+1%",