From 8f7f8eaab6421e5a5ad133552d35cb3b171a3e8e Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Thu, 6 Jun 2024 11:20:37 +0700 Subject: [PATCH] no message --- src/controllers/ImportDataController.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/controllers/ImportDataController.ts b/src/controllers/ImportDataController.ts index 19479598..39619890 100644 --- a/src/controllers/ImportDataController.ts +++ b/src/controllers/ImportDataController.ts @@ -23,8 +23,8 @@ import { FileInterceptor } from "@nestjs/platform-express"; import * as xlsx from "xlsx"; import { ProfileEducation } from "../entities/ProfileEducation"; -@Route("api/v1/development/scholarship") -@Tags("DevelopmentScholarship") +@Route("api/v1/org/upload") +@Tags("UPLOAD") @Security("bearerAuth") export class ImportDataController extends Controller { private educationRepository = AppDataSource.getRepository(ProfileEducation); @@ -34,14 +34,11 @@ export class ImportDataController extends Controller { * @summary DEV_0 - upload EDU # * */ - @Post("upload") + @Post("") @UseInterceptors(FileInterceptor("file")) - async UploadUserDevelopemtById( - @UploadedFile() file: Express.Multer.File, - ) { - + async UploadUserDevelopemtById(@UploadedFile() file: Express.Multer.File) { const workbook = xlsx.read(file.buffer, { type: "buffer" }); - const sheetName = workbook.SheetNames[1]; + const sheetName = workbook.SheetNames[1]; const sheet = workbook.Sheets[sheetName]; const getEducations = xlsx.utils.sheet_to_json(sheet);