diff options
author | Sonja Galovic <galovicsonja@gmail.com> | 2022-04-10 23:03:44 +0200 |
---|---|---|
committer | Sonja Galovic <galovicsonja@gmail.com> | 2022-04-10 23:03:44 +0200 |
commit | 8097c0ced5e16657a92ca08fa788839147a4b56f (patch) | |
tree | 1c696748de1ee638ae4e6c8fb1e406e27f2d6f54 /backend | |
parent | 2c60aea56e74c4589227ee0d022453011adc772f (diff) |
Datasetovi - izmene i testiranje
Diffstat (limited to 'backend')
-rw-r--r-- | backend/api/api/Controllers/FileController.cs | 12 |
1 files changed, 6 insertions, 6 deletions
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<List<string>> CsvRead(bool hasHeader, string fileId) + public ActionResult<string> 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)); } |