Carrusel envia mensaje de error enlugar de detener el servicio
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 185 KiB |
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user