Fixed a lot of stuff

This commit is contained in:
2025-11-03 13:39:34 -06:00
parent b4edcd8da6
commit 3a7e0bba3c
6 changed files with 42 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
import {Router} from 'express';
import { createCommunity, getCommunityById, getAllCommunities, deleteCommunity, editCommunity } from '../functions/communityFunctions.js';
import { createNewCommunity, getCommunityById, getAllCommunities, deleteCommunity, editCommunity } from '../functions/communityFunctions.js';
const router = Router();
// Validate create community payload
@@ -11,8 +11,10 @@ const validateCommunityPayload = (req, res, next) => {
next();
};
router.post('/', validateCommunityPayload, createCommunity);
router.post('/', validateCommunityPayload, createNewCommunity);
router.get('/', getAllCommunities);
router.get('/:id_comunidad', getCommunityById);
router.put('/:id_comunidad', validateCommunityPayload, editCommunity);
router.delete('/:id_comunidad', deleteCommunity);
router.delete('/:id_comunidad', deleteCommunity);
export default router;