Skip to content

Commit

Permalink
Merge pull request #31 from CougarCS/new-tutor-dev
Browse files Browse the repository at this point in the history
Fix tutor log bug
  • Loading branch information
Mnguyener authored Jan 29, 2024
2 parents 6592b7a + 75fbc10 commit b7bb9bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/supabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ export const getTutor = async (
return tutorResponse;
}

const mostRecentTutor = tutorResponse.data[0];
const mostRecentTutor = tutorResponse.data[tutorResponse.data.length - 1];

const now = new Date();
const tutorStart = new Date(mostRecentTutor.start_date);
Expand All @@ -896,7 +896,7 @@ export const getTutor = async (
if (now > tutorStart && now < tutorEnd) {
return {
...tutorResponse,
data: tutorResponse.data[0],
data: mostRecentTutor,
};
}

Expand Down

0 comments on commit b7bb9bc

Please sign in to comment.