From 8097c0ced5e16657a92ca08fa788839147a4b56f Mon Sep 17 00:00:00 2001 From: Sonja Galovic Date: Sun, 10 Apr 2022 23:03:44 +0200 Subject: Datasetovi - izmene i testiranje --- backend/api/api/Controllers/FileController.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'backend') diff --git a/backend/api/api/Controllers/FileController.cs b/backend/api/api/Controllers/FileController.cs index ad788e17..daff0d44 100644 --- a/backend/api/api/Controllers/FileController.cs +++ b/backend/api/api/Controllers/FileController.cs @@ -98,7 +98,7 @@ namespace api.Controllers [HttpGet("csvread/{hasHeader}/{fileId}")] [Authorize(Roles = "User,Guest")] - public ActionResult> CsvRead(bool hasHeader, string fileId) + public ActionResult CsvRead(bool hasHeader, string fileId) { string uploaderId; @@ -118,12 +118,12 @@ namespace api.Controllers //String csvContent = System.IO.File.ReadAllText(fileModel.path); string filePath = _fileservice.GetFilePath(fileId, uploaderId); - - if(hasHeader) - return System.IO.File.ReadLines(filePath).Take(11).ToList(); - else - return System.IO.File.ReadLines(filePath).Take(10).ToList(); + + if (hasHeader) + return String.Join("", System.IO.File.ReadLines(filePath).Take(11)); + else + return String.Join("", System.IO.File.ReadLines(filePath).Take(10)); } -- cgit v1.2.3