Skip to content

Commit 55fbdfd

Browse files
committed
fix build error
1 parent 05d650b commit 55fbdfd

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

__tests__/integration/update-game-stats.test.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ describe('updateGameStats', () => {
1717
it('should add game stats when none are in db', async () => {
1818
// if season hasn't started yet, this will be 0
1919
// so skip test
20-
if (getCurrentSeason() > new Date().getFullYear() && new Date().getMonth() < 11) return
20+
if (
21+
getCurrentSeason() > new Date().getFullYear() &&
22+
new Date().getMonth() < 11
23+
)
24+
return
2125
await updateGameStats()
2226

2327
const count = await prisma.playerGame.count()

__tests__/integration/update-season-average.test.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ describe('updateSeasonAverages', () => {
1515
it('should update season averages when none are in db', async () => {
1616
// if season hasn't started yet, this will be 0
1717
// so skip test
18-
if (getCurrentSeason() > new Date().getFullYear() && new Date().getMonth() < 11) return
19-
18+
if (
19+
getCurrentSeason() > new Date().getFullYear() &&
20+
new Date().getMonth() < 11
21+
)
22+
return
23+
2024
const playerCount = await prisma.player.count()
2125
await updateSeasonAverages()
2226

src/components/Roster.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const RosterItemSkeleton: FC = () => {
5050
}
5151

5252
const RosterItem: FC<RosterItemProps> = async ({ player }) => {
53-
let average: player.ISeasonAverage | undefined
53+
let average: player.ISeasonAverage | undefined | null
5454

5555
try {
5656
average = (await serverClient.getSeasonAverage({ id: player.id }))

src/server/functions/update-schedule.ts

+9-5
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,24 @@ export const updateSchedule = async (): Promise<void> => {
1515
])
1616

1717
const newGamesNotInDb = schedule.filter(
18-
game =>
19-
!scheduleInDb.some(gameInDb => game.date === gameInDb.date)
18+
game => !scheduleInDb.some(gameInDb => game.date === gameInDb.date)
2019
)
2120

2221
const gamesToUpdate = schedule.filter(game =>
2322
scheduleInDb.some(
2423
gameInDb =>
2524
sameDay(gameInDb.date, game.date) &&
26-
!scheduleGameIsEqual(game, gameInDb)
27-
&& game.opponent_name === gameInDb.opponent.name
25+
!scheduleGameIsEqual(game, gameInDb) &&
26+
game.opponent_name === gameInDb.opponent.name
2827
)
2928
)
3029

31-
console.log(schedule.length, newGamesNotInDb.length, gamesToUpdate.length, scheduleInDb.length)
30+
console.log(
31+
schedule.length,
32+
newGamesNotInDb.length,
33+
gamesToUpdate.length,
34+
scheduleInDb.length
35+
)
3236

3337
if (gamesToUpdate.length > 0)
3438
await Promise.all(

0 commit comments

Comments
 (0)