Fixing incorrect inequality when fetching schedulable reservations
This commit is contained in:
parent
94ddf55639
commit
01a6013093
1 changed files with 7 additions and 6 deletions
|
|
@ -48,12 +48,13 @@ export class ReservationsService {
|
||||||
async getSchedulable() {
|
async getSchedulable() {
|
||||||
const query = this.reservationsRepository
|
const query = this.reservationsRepository
|
||||||
.createQueryBuilder()
|
.createQueryBuilder()
|
||||||
.where(`DATE(dateRangeStart) >= DATE(:startDate)`, {
|
.where(
|
||||||
|
`(DATE(dateRangeStart) >= DATE(:startDate) OR DATE(dateRangeStart) <= DATE(:endDate))`,
|
||||||
|
{
|
||||||
startDate: dayjs().add(1, 'days').toISOString(),
|
startDate: dayjs().add(1, 'days').toISOString(),
|
||||||
})
|
|
||||||
.andWhere(`DATE(dateRangeStart) <= DATE(:endDate)`, {
|
|
||||||
endDate: dayjs().add(7, 'days').toISOString(),
|
endDate: dayjs().add(7, 'days').toISOString(),
|
||||||
})
|
},
|
||||||
|
)
|
||||||
.andWhere('status = :status', {
|
.andWhere('status = :status', {
|
||||||
statuses: ReservationStatus.Pending,
|
statuses: ReservationStatus.Pending,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue