refacto site settings
Some checks failed
Dotnet build and test / build (pull_request) Failing after 8m29s
Some checks failed
Dotnet build and test / build (pull_request) Failing after 8m29s
This commit is contained in:
parent
3e7e76edf2
commit
3bc4142383
33 changed files with 399 additions and 315 deletions
|
|
@ -1,20 +1,25 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Yavsc.Server.Helpers;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
namespace Yavsc.Org.Controllers
|
||||
{
|
||||
public class FileSystemController : Controller
|
||||
{
|
||||
public FileSystemController()
|
||||
private SiteSettings _siteSettings;
|
||||
|
||||
public FileSystemController(IOptions<SiteSettings> siteSettings)
|
||||
{
|
||||
_siteSettings = siteSettings.Value;
|
||||
}
|
||||
// Removed redundant empty constructor block
|
||||
|
||||
public IActionResult Index(string subdir="")
|
||||
{
|
||||
{
|
||||
if (subdir !=null)
|
||||
if (!subdir.IsValidYavscPath())
|
||||
return new BadRequestResult();
|
||||
var files = AbstractFileSystemHelpers.GetUserFiles(User.GetUserId(), subdir);
|
||||
var files = FileSystemHelpers.GetUserFiles(_siteSettings, User.GetUserId(), subdir);
|
||||
return View(files);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue