From 144356b1fd07f30c2637b2c76ae6192dc276b86d Mon Sep 17 00:00:00 2001 From: Yashvardhan Jagnani Date: Wed, 4 Sep 2024 18:05:58 +0530 Subject: [PATCH] fix: season check --- packages/backend/microservices/seasons/seasons.service.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/backend/microservices/seasons/seasons.service.ts b/packages/backend/microservices/seasons/seasons.service.ts index 34d9e8c..fbd8ab0 100644 --- a/packages/backend/microservices/seasons/seasons.service.ts +++ b/packages/backend/microservices/seasons/seasons.service.ts @@ -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) { @@ -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();