-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add driver,customer,farmer count.Add PDF generator (#88)
Co-authored-by: IT22171856 <142132191+IT22171856@users.noreply.github.com> Co-authored-by: NIMENDRA <nimendradilshan11@gmail.com>
- Loading branch information
1 parent
1d712f1
commit 14911d1
Showing
19 changed files
with
898 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
import Farmer from '../../models/farmerModel' | ||
import mongoose from 'mongoose' | ||
export const getFarmersCount = async (req, res) => { | ||
try { | ||
const count = await Farmer.countDocuments() | ||
res.status(200).json({ count }) | ||
} catch (error) { | ||
res.status(500).json({ error: 'Error fetching staff count' }) | ||
} | ||
} | ||
|
||
export const getAllFarmers = async (req, res) => { | ||
try { | ||
const farmer = await Farmer.find({}) // Change sorting to firstName | ||
res.status(200).json(farmer) | ||
} catch (error) { | ||
res.status(500).json({ message: error.message }) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -378,3 +378,4 @@ export { | |
verifyPassword, | ||
getAllDrivers, | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import express from 'express' | ||
import { | ||
getFarmersCount, | ||
getAllFarmers, | ||
} from '../../controllers/Admin/Afarmer' | ||
|
||
const router = express.Router() | ||
|
||
router.get('/', getAllFarmers) | ||
router.post('/count', getFarmersCount) | ||
|
||
export default router |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Link } from 'react-router-dom' | ||
import logo from '../../assets/Logo.png' | ||
const Header = () => { | ||
return ( | ||
<div> | ||
<div className="flex items-center justify-between py-6 mx-auto border-b max-w-7xl"> | ||
<div> | ||
<Link to="/"> | ||
<img src={logo} alt="Logo" width={160} height={160} /> | ||
</Link> | ||
</div> | ||
|
||
<div className="flex items-center gap-4 text-sm"> | ||
<div className="flex items-center gap-4"> | ||
<h1>Welcome to FarmCart🌱 </h1> | ||
<Link | ||
to="/help" | ||
className="text-black hover:text-[#99DD05] cursor-pointer hover:underline text-sm" | ||
> | ||
Help & Support | ||
</Link> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default Header |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Outlet } from 'react-router-dom' | ||
import Footer from '../Components/Home/FooterDashboard' | ||
import Header from '../Components/Admin/Aheader' | ||
|
||
function AdminLayout() { | ||
return ( | ||
<> | ||
<div className="sticky top-0 bg-white shadow-md bg-opacity-70 backdrop-blur-md z-50"> | ||
<Header /> | ||
|
||
</div> | ||
|
||
<Outlet /> | ||
<div className="sticky top-0 bg-white shadow-md bg-opacity-70 backdrop-blur-md z-50"> | ||
<Footer /> | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
export default AdminLayout |
Oops, something went wrong.