15 lines
499 B
TypeScript
15 lines
499 B
TypeScript
import { Controller, Post, UploadedFile, UseInterceptors, Query } from '@nestjs/common';
|
|
import { FileInterceptor } from '@nestjs/platform-express';
|
|
import { ImportService } from './import.service';
|
|
|
|
@Controller('import')
|
|
export class ImportController {
|
|
constructor(private readonly svc: ImportService) {}
|
|
|
|
@Post('excel')
|
|
@UseInterceptors(FileInterceptor('file'))
|
|
async importExcel(@UploadedFile() file: any, @Query('tipo') tipo: string) {
|
|
return this.svc.importExcel(file, tipo);
|
|
}
|
|
}
|