2024-09-12 08:11:07 +00:00
|
|
|
import express from 'express';
|
|
|
|
const router = express.Router();
|
|
|
|
import auth from '../middleware/auth.js';
|
2024-09-25 14:20:59 +00:00
|
|
|
import { createProperty, getUserProperties, getPropertyById, updatePropertyById, getProperties} from '../controllers/property.js';
|
2024-09-12 08:11:07 +00:00
|
|
|
|
|
|
|
router.post('/', auth, createProperty);
|
2024-09-16 10:55:17 +00:00
|
|
|
router.get('/user/:userId', getUserProperties);
|
2024-09-16 15:03:26 +00:00
|
|
|
router.get('/:propertyId', getPropertyById);
|
2024-09-21 19:01:44 +00:00
|
|
|
router.put("/:id", updatePropertyById);
|
2024-09-25 14:20:59 +00:00
|
|
|
router.get('/', getProperties);
|
2024-09-16 15:03:26 +00:00
|
|
|
|
2024-09-12 08:11:07 +00:00
|
|
|
export default router;
|