Changing schedulable to not return past reservations
This commit is contained in:
parent
82bfe43bbb
commit
3ede46abe2
1 changed files with 7 additions and 3 deletions
|
|
@ -42,9 +42,13 @@ export class ReservationsService {
|
||||||
async getSchedulable() {
|
async getSchedulable() {
|
||||||
const query = this.reservationsRepository
|
const query = this.reservationsRepository
|
||||||
.createQueryBuilder()
|
.createQueryBuilder()
|
||||||
.where(`DATE(dateRangeStart) <= DATE(:date)`, {
|
.where(
|
||||||
date: dayjs().add(7, 'days').toISOString(),
|
`DATE(dateRangeStart) BETWEEN DATE(:startDate) AND DATE(:endDate)`,
|
||||||
})
|
{
|
||||||
|
startDate: dayjs().add(7, 'days').toISOString(),
|
||||||
|
endDate: dayjs().toISOString(),
|
||||||
|
},
|
||||||
|
)
|
||||||
.andWhere(`waitListed = false`)
|
.andWhere(`waitListed = false`)
|
||||||
|
|
||||||
return await query.getMany()
|
return await query.getMany()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue