diff options
author | Sonja Galovic <galovicsonja@gmail.com> | 2022-04-28 14:23:12 +0200 |
---|---|---|
committer | Sonja Galovic <galovicsonja@gmail.com> | 2022-04-28 14:23:12 +0200 |
commit | 0d3739e71f969f429cb1e036d0b57ad1b52658e1 (patch) | |
tree | 38867731e5671c2ab3e8cfefdf5115c6adf58904 /backend | |
parent | adbd70386b4fa13c940eed643cd1b252b5243051 (diff) | |
parent | 6eb541aa0cf268c41bf8638b73bf764d717be80b (diff) |
Merge branch 'redesign' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into redesign
Diffstat (limited to 'backend')
-rw-r--r-- | backend/api/api/Controllers/FileController.cs | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/backend/api/api/Controllers/FileController.cs b/backend/api/api/Controllers/FileController.cs index 0e9f9b97..9baf6294 100644 --- a/backend/api/api/Controllers/FileController.cs +++ b/backend/api/api/Controllers/FileController.cs @@ -94,30 +94,9 @@ namespace api.Controllers return Ok(fileModel._id); } - [HttpGet("csvread/{hasHeader}/{fileId}")] - [Authorize(Roles = "User,Guest")] - public ActionResult<string> CsvRead(bool hasHeader, string fileId) - { - - string uploaderId = getUserId(); - - if (uploaderId == null) - return BadRequest(); - - //String csvContent = System.IO.File.ReadAllText(fileModel.path); - string filePath = _fileservice.GetFilePath(fileId, uploaderId); - - - - if (hasHeader) - return String.Join("\n", System.IO.File.ReadLines(filePath).Take(11)); - else - return String.Join("\n", System.IO.File.ReadLines(filePath).Take(10)); - } - [HttpGet("csvread/{hasHeader}/{fileId}/{skipRows}/{takeRows}")] [Authorize(Roles = "User,Guest")] - public ActionResult<string> CsvRead(bool hasHeader, string fileId, int skipRows, int takeRows) + public ActionResult<string> CsvRead(bool hasHeader, string fileId, int skipRows = 0, int takeRows = 10) { string uploaderId = getUserId(); |