aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorOgnjen Cirkovic <ciraboxkg@gmail.com>2022-04-27 20:58:31 +0200
committerOgnjen Cirkovic <ciraboxkg@gmail.com>2022-04-27 20:58:31 +0200
commite8b2adf435bdf49e509659a01f7d48c7c26c9b60 (patch)
treeaf2ba5f13d0605d5991514af567c2d4742e52fc6 /backend
parentd28576bff04b0f5ea9a58037ffee7c4157aa2c61 (diff)
parent0907f23080e16af1813e9e445f26a44ed1dc7a5b (diff)
Merge branch 'redesign' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into Redesign
# Conflicts: # frontend/src/app/_elements/column-table/column-table.component.css
Diffstat (limited to 'backend')
-rw-r--r--backend/api/api/Controllers/FileController.cs23
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();