Skip to content

Commit

Permalink
Make sure Events are registered
Browse files Browse the repository at this point in the history
  • Loading branch information
JiashuHarryHuang committed Apr 27, 2024
1 parent 35932ab commit 1e65731
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pages/api/volunteer-logs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { getSession } from 'next-auth/react';
import VolunteerLogs from 'bookem-shared/src/models/VolunteerLogs';
import Users from 'bookem-shared/src/models/Users';
import { QueriedUserData } from 'bookem-shared/src/types/database';
import VolunteerEvents from 'bookem-shared/src/models/VolunteerEvents';

/**
* /api/VolunteerLogs/:
Expand Down Expand Up @@ -58,6 +59,7 @@ export default async function handler(

const usersId = user._id;

await VolunteerEvents.findOne();
// get all volunteerEvents from collection that match the user's Id
const volunteerLogs = await VolunteerLogs.find({
userId: usersId,
Expand Down

0 comments on commit 1e65731

Please sign in to comment.