se agregó endpoint de ejemplo
This commit is contained in:
@@ -8,12 +8,14 @@ import {
|
||||
Get,
|
||||
Query,
|
||||
Post,
|
||||
Res,
|
||||
} from '@nestjs/common';
|
||||
import { EquipoService } from './equipo.service';
|
||||
import { UpdateEquipoDto } from './dto/update-equipo.dto';
|
||||
import { AuthGuard } from '@nestjs/passport';
|
||||
import { Equipo } from './entities/equipo.entity';
|
||||
import { CreateEquipoDto } from './dto/create-equipo.dto';
|
||||
import type { Response } from 'express';
|
||||
|
||||
@Controller('equipos')
|
||||
export class EquipoController {
|
||||
@@ -107,4 +109,19 @@ export class EquipoController {
|
||||
) {
|
||||
return this.equipoService.findAllProcesadorforTipoEquipos(idEquipo);
|
||||
}
|
||||
|
||||
@Get('reporte')
|
||||
async generarReporte(@Res() res: Response) {
|
||||
try {
|
||||
await this.equipoService.createEcxel(res);
|
||||
} catch (error) {
|
||||
console.error('Error al generar el Excel:', error);
|
||||
res.status(500).send('Error al generar el archivo Excel');
|
||||
}
|
||||
}
|
||||
|
||||
@Post('example')
|
||||
async generate() {
|
||||
this.equipoService.example();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user