aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
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();