diff --git a/backend/src/api.ts b/backend/src/api.ts index c974dd1d4..1ef784e51 100644 --- a/backend/src/api.ts +++ b/backend/src/api.ts @@ -252,9 +252,13 @@ router.get('/member-image', async (_, res) => { }); // Shoutouts -loginCheckedGet('/shoutout/:email', async (req, user) => ({ +loginCheckedGet('/shoutout/:email', async (req, user) => { + console.log(req.query.type) + console.log(req.query) + return ({ shoutouts: await getShoutouts(req.params.email, req.query.type as 'given' | 'received', user) -})); +})} +); loginCheckedGet('/shoutout', async () => ({ shoutouts: await getAllShoutouts() diff --git a/frontend/src/API/ShoutoutsAPI.ts b/frontend/src/API/ShoutoutsAPI.ts index fceb83c3c..d8d0a4603 100644 --- a/frontend/src/API/ShoutoutsAPI.ts +++ b/frontend/src/API/ShoutoutsAPI.ts @@ -24,7 +24,7 @@ export default class ShoutoutsAPI { } public static getShoutouts(email: string, type: 'given' | 'received'): Promise { - const responseProm = APIWrapper.get(`${backendURL}/shoutout/${email}?type=${type}}`).then( + const responseProm = APIWrapper.get(`${backendURL}/shoutout/${email}?type=${type}`).then( (res) => res.data ); return responseProm.then((val) => {