aboutsummaryrefslogtreecommitdiff
path: root/backend/api
diff options
context:
space:
mode:
Diffstat (limited to 'backend/api')
-rw-r--r--backend/api/api/Controllers/FileController.cs12
-rw-r--r--backend/api/api/Services/IFileService.cs2
2 files changed, 5 insertions, 9 deletions
diff --git a/backend/api/api/Controllers/FileController.cs b/backend/api/api/Controllers/FileController.cs
index 05694166..ac17ab0b 100644
--- a/backend/api/api/Controllers/FileController.cs
+++ b/backend/api/api/Controllers/FileController.cs
@@ -4,10 +4,7 @@ using api.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Net.Http.Headers;
-using CsvHelper;
-using System.IO;
-using System.Globalization;
-using System.Linq;
+
namespace api.Controllers
{
@@ -18,9 +15,8 @@ namespace api.Controllers
private string[] permittedExtensions = { ".csv",".json",".xls",".xlsx" };
private string[] permittedExtensionsH5 = { ".h5" };//niz da bi dodali h4 itd
private readonly IConfiguration _configuration;
- private readonly IFileService _fileService;
private IJwtToken _token;
- private IFileService _fileservice;
+ private readonly IFileService _fileservice;
public FileController(IConfiguration configuration,IFileService fileService,IJwtToken token)
{
_configuration = configuration;
@@ -100,7 +96,7 @@ namespace api.Controllers
return Ok(fileModel);
}
- [HttpGet("csvread/{hasheader}/{fileid}")]
+ [HttpGet("csvread/{hasHeader}/{fileId}")]
[Authorize(Roles = "User,Guest")]
public ActionResult<List<string>> CsvRead(bool hasHeader, string fileId)
{
@@ -120,7 +116,7 @@ namespace api.Controllers
return BadRequest();
//String csvContent = System.IO.File.ReadAllText(fileModel.path);
- string filePath = _fileService.GetFilePath(fileId, uploaderId);
+ string filePath = _fileservice.GetFilePath(fileId, uploaderId);
diff --git a/backend/api/api/Services/IFileService.cs b/backend/api/api/Services/IFileService.cs
index d65deb48..01a1c410 100644
--- a/backend/api/api/Services/IFileService.cs
+++ b/backend/api/api/Services/IFileService.cs
@@ -5,7 +5,7 @@ namespace api.Services
public interface IFileService
{
FileModel Create(FileModel file);
- string GetFilePath(string id, string username);
+ string GetFilePath(string id, string uploaderId);
public FileModel getFile(string id);
}
} \ No newline at end of file