import { Controller, Get, Query } from '@nestjs/common';
import { CertificatesService } from './certificates.service';
import { ApiTags, ApiOperation } from '@nestjs/swagger';
import { Public } from '../auth/public.decorator';

@ApiTags('certificates')
@Controller('certificates')
export class CertificatesController {
  constructor(private readonly certificatesService: CertificatesService) {}

  @Public()
  @Get()
  @ApiOperation({ summary: 'Get available certificates' })
  async findAll(@Query('search') search?: string) {
    return this.certificatesService.findAll(search);
  }
}
