From f401089fdd60b49b29814e5ba9374fe81f0f12cd Mon Sep 17 00:00:00 2001 From: Harry Huang Date: Tue, 16 Apr 2024 00:13:24 -0500 Subject: [PATCH 1/2] npm i --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 832ccb9..3a6355d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4175,7 +4175,7 @@ }, "node_modules/bookem-shared": { "version": "1.0.0", - "resolved": "git+ssh://git@github.com/ChangePlusPlusVandy/bookem-shared.git#526c66db3beb77a2570b5fbbff90941e5040531e", + "resolved": "git+ssh://git@github.com/ChangePlusPlusVandy/bookem-shared.git#23ae314acc07b37be04e9f49f6055b31650d1dd5", "license": "ISC", "dependencies": { "mongoose": "^6.8.3" From 5d4db2147c9809b4099e637047bcef455ad5bcb7 Mon Sep 17 00:00:00 2001 From: Harry Huang Date: Tue, 16 Apr 2024 00:25:15 -0500 Subject: [PATCH 2/2] Add return --- pages/api/volunteer-logs/approved.ts | 4 ++-- pages/api/volunteer-logs/pending.ts | 2 +- pages/api/volunteer-logs/rejected.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pages/api/volunteer-logs/approved.ts b/pages/api/volunteer-logs/approved.ts index 09d88e7..bbaef88 100644 --- a/pages/api/volunteer-logs/approved.ts +++ b/pages/api/volunteer-logs/approved.ts @@ -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({ @@ -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', }); diff --git a/pages/api/volunteer-logs/pending.ts b/pages/api/volunteer-logs/pending.ts index de0ce94..b5e6c27 100644 --- a/pages/api/volunteer-logs/pending.ts +++ b/pages/api/volunteer-logs/pending.ts @@ -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({ diff --git a/pages/api/volunteer-logs/rejected.ts b/pages/api/volunteer-logs/rejected.ts index 5d78328..2f65e85 100644 --- a/pages/api/volunteer-logs/rejected.ts +++ b/pages/api/volunteer-logs/rejected.ts @@ -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({ @@ -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', });