Create and Test User and Farm Routes

This commit is contained in:
2025-02-22 17:03:24 +05:30
parent 1fdb739950
commit 330589bdf1
14 changed files with 617 additions and 27 deletions
+20
View File
@@ -0,0 +1,20 @@
import express from "express";
import {
createCrop,
getCrops,
getCropById,
updateCrop,
deleteCrop,
} from "../controllers/cropController.js";
import { checkAuthenticated } from "../Middlewares/authentication.js";
const router = express.Router();
// Routes for crop management
router.post("/", checkAuthenticated, createCrop); // Create a new crop
router.get("/", checkAuthenticated, getCrops); // Get all crops
router.get("/:cropId", checkAuthenticated, getCropById); // Get a crop by ID
router.put("/:cropId", checkAuthenticated, updateCrop); // Update crop details
router.delete("/:cropId", checkAuthenticated, deleteCrop); // Delete a crop
export default router;