mark booking query params optional in swagger
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
|||||||
Query,
|
Query,
|
||||||
UseGuards,
|
UseGuards,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
|
import { ApiQuery } from '@nestjs/swagger';
|
||||||
import { BookingEntity, BookingStatus } from '../../entities/booking.entity';
|
import { BookingEntity, BookingStatus } from '../../entities/booking.entity';
|
||||||
import { UserRole } from '../../entities/user.entity';
|
import { UserRole } from '../../entities/user.entity';
|
||||||
import { AuthUser } from '../auth/auth.types';
|
import { AuthUser } from '../auth/auth.types';
|
||||||
@@ -27,6 +28,9 @@ export class BookingsController {
|
|||||||
@Get()
|
@Get()
|
||||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||||
@Roles(UserRole.ADMIN, UserRole.BUSINESS_OWNER, UserRole.CUSTOMER)
|
@Roles(UserRole.ADMIN, UserRole.BUSINESS_OWNER, UserRole.CUSTOMER)
|
||||||
|
@ApiQuery({ name: 'customerId', required: false })
|
||||||
|
@ApiQuery({ name: 'businessId', required: false })
|
||||||
|
@ApiQuery({ name: 'status', required: false, enum: BookingStatus })
|
||||||
findAll(
|
findAll(
|
||||||
@Query('customerId') customerId?: string,
|
@Query('customerId') customerId?: string,
|
||||||
@Query('businessId') businessId?: string,
|
@Query('businessId') businessId?: string,
|
||||||
|
|||||||
Reference in New Issue
Block a user