NestJS - Pipes
Identify the error in this file validation pipe code:
export class FileValidationPipe implements PipeTransform {
transform(file: Express.Multer.File) {
if (!file) throw new BadRequestException('File is required');
if (file.mimetype !== 'image/png' || file.mimetype !== 'image/jpeg') {
throw new BadRequestException('Invalid file type');
}
return file;
}
}