Skip to content

Commit

Permalink
remove extraneous } in shoutoutsapi request
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew032011 committed Sep 23, 2023
1 parent c7b54fe commit e0cb360
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions backend/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/API/ShoutoutsAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class ShoutoutsAPI {
}

public static getShoutouts(email: string, type: 'given' | 'received'): Promise<Shoutout[]> {
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) => {
Expand Down

0 comments on commit e0cb360

Please sign in to comment.