Carrusel envia mensaje de error enlugar de detener el servicio

This commit is contained in:
2023-06-26 12:51:29 -06:00
parent e2afc63e28
commit e4a56184d5
2 changed files with 8 additions and 10 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 KiB

+8 -10
View File
@@ -34,13 +34,11 @@ export class CarruselController {
},
}),
fileFilter: function (req, file, cb) {
if (!file.originalname.match(/\.(jpg|jpeg|png|gif)$/)) {
return cb(
new Error(
'Lo sentimos, para mejorar la calidad de las imagenes en el carousel solo se aceptan imagenes con terminación: .jpeg .jpg .png .webp',
),
false,
);
if (!file.originalname.match(/\.(jpg|jpeg|png|webp)$/)) {
return {
message:
'Lo sentimos los archivos permitidos para usar el carrusel son jpg jpeg png webp',
};
}
cb(null, true);
},
@@ -63,8 +61,8 @@ export class CarruselController {
return this.carruselService.deleteImagenByRuta(id);
}
@Get("imagenes")
getAllImagenes(){
return this.carruselService.getAllImages()
@Get('imagenes')
getAllImagenes() {
return this.carruselService.getAllImages();
}
}