Default timePeriod to null instead of undefined

This commit is contained in:
Brian Beck 2021-09-26 00:50:59 -07:00
parent 3114913c85
commit 08010956a8

View file

@ -56,7 +56,7 @@ export class PlayersService {
minGames, minGames,
minShots, minShots,
limit, limit,
timePeriod, timePeriod = null,
} = topAccuracyQuery; } = topAccuracyQuery;
const shotsStat = { const shotsStat = {
@ -206,7 +206,7 @@ export class PlayersService {
} }
async findTopWins(topWinsQuery: TopWinsQueryDto) { async findTopWins(topWinsQuery: TopWinsQueryDto) {
const { minGames, limit, timePeriod } = topWinsQuery; const { minGames, limit, timePeriod = null } = topWinsQuery;
const sinceDate = '(now() - (:timePeriod)::interval)'; const sinceDate = '(now() - (:timePeriod)::interval)';