Skip to content

Commit

Permalink
Order leagues
Browse files Browse the repository at this point in the history
  • Loading branch information
renatodellosso committed Feb 13, 2025
1 parent 06d0956 commit 896165d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
16 changes: 12 additions & 4 deletions pages/[teamSlug]/createSeason.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Season, Team } from "../../lib/Types";
import { League, Season, Team } from "../../lib/Types";
import UrlResolver, { SerializeDatabaseObjects } from "@/lib/UrlResolver";
import { GetServerSideProps } from "next";
import Container from "@/components/Container";
Expand Down Expand Up @@ -41,9 +41,17 @@ export default function CreateSeason(props: CreateSeasonProps) {
);
};

const gamesWithIds = Object.entries(games).map(([id, game]) => {
return { ...game, id: id as GameId };
});
const gamesWithIds = Object.entries(games)
.map(([id, game]) => {
return { ...game, id: id as GameId };
})
.sort((a, b) => {
return b.year === a.year
? b.league === League.FRC
? 1
: -1
: b.year - a.year;
});

return (
<Container
Expand Down
1 change: 0 additions & 1 deletion public/sw.js.map

This file was deleted.

0 comments on commit 896165d

Please sign in to comment.