Skip to content

Commit 2a47bee

Browse files
BackendExpertJehanKandyAnupa1998
committed
Update DashHome.jsx
Co-Authored-By: JehanKandy <jehankandy@gmail.com> Co-Authored-By: Anupa Gamage <125038143+Anupa1998@users.noreply.github.com>
1 parent b87ab66 commit 2a47bee

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

client/src/components/Dashboard/DashHome.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ const DashHome = () => {
2020
.catch(err => console.log(err))
2121
}, [])
2222

23+
24+
// count users
25+
const [CountUser, SetCountUser] = useState([])
26+
27+
useEffect(() => {
28+
axios.get('http://localhost:5000/auth/CountUsers')
29+
.then(res => SetCountUser(res.data.Result))
30+
.catch(err => console.log(err))
31+
}, [])
32+
2333
const DashData = [
2434
{id: 1, name: "Users", bgstyle: 'bg-green-400/20', borderStyle: 'border-green-500', icon: <BsPeopleFill />, value: <CountUp end={20} />, style: "text-green-500"},
2535
{id: 2, name: "Books", bgstyle: 'bg-blue-400/20', borderStyle: 'border-blue-500', icon: <BsBookFill />, value: <CountUp end={CountBooks} />, style: "text-blue-500"},

0 commit comments

Comments
 (0)