Skip to content

Commit

Permalink
fix: season check
Browse files Browse the repository at this point in the history
  • Loading branch information
jagnani73 committed Sep 4, 2024
1 parent ee46432 commit 144356b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/backend/microservices/seasons/seasons.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const fetchAllSeasons = async () => {
const { data, error } = await SupabaseService.getSupabase()
.from("seasons")
.select()
.lt("started_on", new Date().toISOString())
.order("ended_on", { ascending: false });

if (error) {
Expand All @@ -21,6 +22,7 @@ export const fetchCurrentSeason = async () => {
.from("seasons")
.select()
.gt("ended_on", new Date().toISOString())
.lt("started_on", new Date().toISOString())
.order("ended_on", { ascending: false })
.single();

Expand Down

0 comments on commit 144356b

Please sign in to comment.