File: /var/www/api-parametros/src/app/auditor/controller/auditor.controller.ts
import { Controller, Get, Query, NotFoundException } from '@nestjs/common';
import { AuditService } from '../services/auditor.service';
import { ApiTags } from '@nestjs/swagger';
@ApiTags('audits')
@Controller('audits')
export class AuditController {
constructor(private readonly auditService: AuditService) {}
@Get()
async findAll(
@Query('page') page: number,
@Query('pageSize') pageSize: number,
) {
try {
return await this.auditService.findAll(page, pageSize);
} catch (error) {
throw new NotFoundException('No audits found');
}
}
}