estatesfunding/ef-api/routes/property.js

26 lines
708 B
JavaScript
Raw Normal View History

2024-10-23 17:46:58 +00:00
import express from "express";
2024-09-12 08:11:07 +00:00
const router = express.Router();
2024-10-23 17:46:58 +00:00
import auth from "../middleware/auth.js";
import {
createProperty,
getUserProperties,
getPropertyById,
updatePropertyById,
getProperties,
addFundDetails,
getFundDetails,
2024-10-25 05:34:27 +00:00
deleteFundDetail,
2024-10-23 17:46:58 +00:00
} from "../controllers/property.js";
2024-09-12 08:11:07 +00:00
2024-10-23 17:46:58 +00:00
router.post("/", auth, createProperty);
router.get("/user/:userId", getUserProperties);
router.get("/:propertyId", getPropertyById);
2024-09-21 19:01:44 +00:00
router.put("/:id", updatePropertyById);
2024-10-23 17:46:58 +00:00
router.get("/", getProperties);
router.put("/:id/fund-details", addFundDetails);
router.get("/:id/fund-details", getFundDetails);
2024-10-25 05:34:27 +00:00
router.delete('/:id/fund-details/:fundDetailId', auth, deleteFundDetail);
2024-09-16 15:03:26 +00:00
2024-09-12 08:11:07 +00:00
export default router;