claude/sports-templates-conversion-ILWAM #71
2 changed files with 4 additions and 4 deletions
|
|
@ -155,9 +155,9 @@ export async function findDraftableSportsSeasonBySportId(sportId: string) {
|
|||
const db = database();
|
||||
const today = sql`CURRENT_DATE`;
|
||||
return await db.query.sportsSeasons.findFirst({
|
||||
where: (ss, { and, eq }) =>
|
||||
and(
|
||||
eq(ss.sportId, sportId),
|
||||
where: (ss, ops) =>
|
||||
ops.and(
|
||||
ops.eq(ss.sportId, sportId),
|
||||
lte(ss.draftOn, today),
|
||||
gte(ss.draftOff, today),
|
||||
isNull(ss.fantasySeasonId)
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ export async function loader(args: Route.LoaderArgs) {
|
|||
...template,
|
||||
sportsSeasonIds: (t?.seasonTemplateSports ?? [])
|
||||
.map((ts: { sportId: string }) => draftableSeasonBySportId.get(ts.sportId)?.id)
|
||||
.filter((id): id is string => id != null),
|
||||
.filter((id): id is string => id !== null && id !== undefined),
|
||||
};
|
||||
})
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue