Se modificaron varias cosas y se agrego un endpoint nuevo para hacer pruebas
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
Res,
|
||||
ParseIntPipe,
|
||||
Param,
|
||||
Req,
|
||||
} from '@nestjs/common';
|
||||
import {
|
||||
FileInterceptor,
|
||||
@@ -30,6 +31,19 @@ export class ServicioController {
|
||||
|
||||
// ------------------ POST ------------------
|
||||
|
||||
// Garegue un nuevo endpoint para hacer pruebas
|
||||
@Post('test-upload')
|
||||
@UseInterceptors(FileInterceptor('file'))
|
||||
uploadTest(
|
||||
@UploadedFile() file: Express.Multer.File,
|
||||
@Req() req: any,
|
||||
) {
|
||||
console.log('FILE:', file);
|
||||
console.log('FILES REQ:', req.file);
|
||||
console.log('FILES BODY:', req.body);
|
||||
return { ok: true };
|
||||
}
|
||||
|
||||
@Post('nuevo')
|
||||
@UseGuards(AuthGuard('jwt'))
|
||||
@UseInterceptors(FileInterceptor('cartaAceptacion'))
|
||||
@@ -38,6 +52,9 @@ export class ServicioController {
|
||||
@Body('alumno') alumnoJson: string,
|
||||
) {
|
||||
const dto: CrearServicioDto = JSON.parse(alumnoJson);
|
||||
|
||||
console.log('Archivo recibido:', file);
|
||||
|
||||
return await this.servicioService.registrarNuevoServicio(dto, file);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user