Skip to content

Commit

Permalink
finished Export to PDF/CSV files
Browse files Browse the repository at this point in the history
  • Loading branch information
aashiyaaaa committed Mar 31, 2024
1 parent bcf7173 commit 4916c2b
Show file tree
Hide file tree
Showing 2 changed files with 447 additions and 24 deletions.
11 changes: 11 additions & 0 deletions backend/routes/order_route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ import auth from "../middleware/auth";
import roles from "../middleware/roles";
const router = express.Router();

router.get("/all", (req: Request, res: Response) => {
Order.find()
.then((orders: any) => {
res.send(orders);
})
.catch((err: any) => {
console.error(err);
res.status(500).send({ error: "An error occurred fetching the orders." });
});
});

// Route to fetch an order by its ID
router.get("/:id", [auth, roles.volunteer], (req: Request, res: Response) => {
Order.findById(req.params.id)
Expand Down
Loading

0 comments on commit 4916c2b

Please sign in to comment.