Merge pull request #479 from SyncrowIOT/fix/booking-fixes

SP-1757, SP-1859 fixes
This commit is contained in:
raf-dev1
2025-07-22 13:39:03 +03:00
committed by GitHub
2 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,12 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsDate, IsNotEmpty, IsString, IsUUID, Matches } from 'class-validator';
import {
IsDate,
IsNotEmpty,
IsString,
IsUUID,
Matches,
MinDate,
} from 'class-validator';
export class CreateBookingDto {
@ApiProperty({
@ -15,6 +22,7 @@ export class CreateBookingDto {
})
@IsNotEmpty()
@IsDate()
@MinDate(new Date())
date: Date;
@ApiProperty({ example: '09:00' })

View File

@ -54,7 +54,8 @@ export class BookableSpaceService {
.createQueryBuilder('space')
.leftJoinAndSelect('space.parent', 'parentSpace')
.leftJoinAndSelect('space.community', 'community')
.where('community.project = :project', { project });
.where('space.disabled = :disabled', { disabled: false })
.andWhere('community.project = :project', { project });
if (search) {
qb = qb.andWhere(