Skip to content

Commit

Permalink
Add return
Browse files Browse the repository at this point in the history
  • Loading branch information
JiashuHarryHuang committed Apr 16, 2024
1 parent f401089 commit 5d4db21
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pages/api/volunteer-logs/approved.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default async function handler(
.populate({ path: 'event' })
.exec()) as QueriedVolunteerLogDTO[];

res.status(200).json(logs);
return res.status(200).json(logs);
} catch (e) {
console.error('An error has occurred in index.ts', e);
res.status(500).json({
Expand All @@ -43,7 +43,7 @@ export default async function handler(
{ status: 'approved' }
);

res.status(200).json({
return res.status(200).json({
message: 'The hours have been approved!',
status: 'success',
});
Expand Down
2 changes: 1 addition & 1 deletion pages/api/volunteer-logs/pending.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default async function handler(
.populate({ path: 'event' })
.exec()) as QueriedVolunteerLogDTO[];

res.status(200).json(logs);
return res.status(200).json(logs);
} catch (e) {
console.error('An error has occurred in index.ts', e);
res.status(500).json({
Expand Down
4 changes: 2 additions & 2 deletions pages/api/volunteer-logs/rejected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default async function handler(
.populate({ path: 'event' })
.exec()) as QueriedVolunteerLogDTO[];

res.status(200).json(logs);
return res.status(200).json(logs);
} catch (e) {
console.error('An error has occurred in index.ts', e);
res.status(500).json({
Expand All @@ -44,7 +44,7 @@ export default async function handler(
{ status: 'rejected' }
);

res.status(200).json({
return res.status(200).json({
message: 'The hours have been rejected!',
status: 'success',
});
Expand Down

0 comments on commit 5d4db21

Please sign in to comment.