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() {
|
||||
const query = this.reservationsRepository
|
||||
.createQueryBuilder()
|
||||
.where(`DATE(dateRangeStart) <= DATE(:date)`, {
|
||||
date: dayjs().add(7, 'days').toISOString(),
|
||||
})
|
||||
.where(
|
||||
`DATE(dateRangeStart) BETWEEN DATE(:startDate) AND DATE(:endDate)`,
|
||||
{
|
||||
startDate: dayjs().add(7, 'days').toISOString(),
|
||||
endDate: dayjs().toISOString(),
|
||||
},
|
||||
)
|
||||
.andWhere(`waitListed = false`)
|
||||
|
||||
return await query.getMany()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue