Commit a792909e authored by Diego Iván's avatar Diego Iván
Browse files

agregando pipe de archivos

parent 547dddd5
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
import { PipeTransform, Injectable, BadRequestException } from '@nestjs/common';

@Injectable()
export class FileValidationPipe implements PipeTransform {
  transform(value: any) {
    const size = value.size;
    if (size > 1000000) {
      throw new BadRequestException('File is too large');
    }
    return value;
  }
}