Skip to content

Commit

Permalink
Fix: alphabetized things that I can in the page.tsx file for admin le…
Browse files Browse the repository at this point in the history
…agues.
  • Loading branch information
alexappleget committed Oct 16, 2024
1 parent 5b7e609 commit 2d93d72
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/(admin)/admin/leagues/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@
// Licensed under the MIT License.

'use client';
import { getAllLeagueEntries } from '@/api/apiFunctions';
import { getUserLeagues } from '@/utils/utils';
import { IEntryWithLeague } from '@/components/TableColumns/TableColumns.interface';
import { JSX, useEffect, useState } from 'react';
import TableData from '@/components/TableData/TableData';
import { leagueColumns } from '@/components/TableColumns/TableColumns';
import TableData from '@/components/TableData/TableData';
import { useDataStore } from '@/store/dataStore';
import { getUserLeagues } from '@/utils/utils';
import { getAllLeagueEntries } from '@/api/apiFunctions';
import { IEntryWithLeague } from '@/components/TableColumns/TableColumns.interface';

/**
* Renders the admin page.
* @returns {JSX.Element} - The rendered Admin Leagues page.
*/
const AdminLeagues = (): JSX.Element => {
const { user } = useDataStore((state) => state);
const [leaguesData, setLeaguesData] = useState<IEntryWithLeague[]>([]);
const { user } = useDataStore((state) => state);

/**
* Get all leagues the user is a part of.
*/
const fetchData = async (): Promise<void> => {
try {
const leagues = await getUserLeagues(user.leagues);
const entries = await getAllLeagueEntries({ leagues: user.leagues });
const leagues = await getUserLeagues(user.leagues);
const combinedData = leagues.map((league, index) => ({
aliveEntries: entries[index].alive,
leagueId: '',
Expand Down

0 comments on commit 2d93d72

Please sign in to comment.