Skip to content

Commit

Permalink
Fix: Updated the fetch league data function to now be able to fetch t…
Browse files Browse the repository at this point in the history
…he league info and then grab the targetIDs of the users.
  • Loading branch information
alexappleget committed Nov 6, 2024
1 parent e55c39f commit 8eb3bd6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/(admin)/admin/notifications/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
import { sendEmailNotifications } from './actions/sendEmailNotification';
import { Textarea } from '@/components/Textarea/Textarea';
import React, { useEffect } from 'react';
import { getUserTargets } from './actions/sendEmailNotification';

/**
* The admin home page.
Expand All @@ -34,7 +35,10 @@ const AdminNotifications = (): JSX.Element => {
try {
const leagueId = '66f1a8e300102bff03ff'; // EMAIL TEST LEAGUE (DO NOT CHANGE)
const leagueData = await getCurrentLeague(leagueId);
setGroupUsers(leagueData.participants);
const userTargets = await getUserTargets({
userIDs: leagueData.participants,
});
setGroupUsers(userTargets);
setLeagueName(leagueData.leagueName);
} catch (error) {
console.error('Error Sending Email:', error);
Expand Down

0 comments on commit 8eb3bd6

Please sign in to comment.