Skip to content

Commit

Permalink
Merge pull request #8 from hack4impact-upenn/backend-routes
Browse files Browse the repository at this point in the history
fix routes
  • Loading branch information
Pulkith authored Mar 17, 2024
2 parents 3644103 + 2aefbbb commit acb77f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions server/src/routes/donation.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import {

const router = express.Router();

router.get('/all', isAuthenticated, getAllDonations);
router.get('/all', getAllDonations);

router.get('/type/:type', isAuthenticated, getAllDonationsOfType);

router.get('/:id', isAuthenticated, getDonation);
router.get('/:id', getDonation);

router.get('/donor/:donorId', isAuthenticated, getDonationsByDonorId);

Expand Down
15 changes: 10 additions & 5 deletions server/src/routes/routers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ The prefix should be of the form '/api/ROUTERNAME'
import { Router } from 'express';
import adminRouter from './admin.route';
import authRouter from './auth.route';
import donationRouter from './donation.route';
import donorRouter from './donor.route';
import groupRouter from './group.route';
import purposeRouter from './purpose.route';
import communicationRouter from './communication.route';

const prefixToRouterMap: { prefix: string; router: Router }[] = [
{
Expand All @@ -21,23 +26,23 @@ const prefixToRouterMap: { prefix: string; router: Router }[] = [
},
{
prefix: '/api/donation',
router: adminRouter,
router: donationRouter,
},
{
prefix: '/api/donor',
router: adminRouter,
router: donorRouter,
},
{
prefix: '/api/group',
router: adminRouter,
router: groupRouter,
},
{
prefix: '/api/purpose',
router: adminRouter,
router: purposeRouter,
},
{
prefix: '/api/communication',
router: adminRouter,
router: communicationRouter,
},
];

Expand Down

0 comments on commit acb77f5

Please sign in to comment.