diff --git a/Oqtane.Client/Services/FolderService.cs b/Oqtane.Client/Services/FolderService.cs index b6c5ff93..556309ad 100644 --- a/Oqtane.Client/Services/FolderService.cs +++ b/Oqtane.Client/Services/FolderService.cs @@ -29,7 +29,7 @@ namespace Oqtane.Services public async Task GetFolderAsync(int siteId, [NotNull] string folderPath) { var path = WebUtility.UrlEncode(folderPath); - return await GetJsonAsync($"{ApiUrl}/{siteId}/{path}"); + return await GetJsonAsync($"{ApiUrl}/path/{siteId}/?path={path}"); } public async Task AddFolderAsync(Folder folder) diff --git a/Oqtane.Server/Controllers/FolderController.cs b/Oqtane.Server/Controllers/FolderController.cs index 24d252a7..616b24d2 100644 --- a/Oqtane.Server/Controllers/FolderController.cs +++ b/Oqtane.Server/Controllers/FolderController.cs @@ -84,10 +84,11 @@ namespace Oqtane.Controllers } } - [HttpGet("{siteId}/{path}")] + // GET api//path/x/?path=y + [HttpGet("path/{siteId}")] public Folder GetByPath(int siteId, string path) { - var folderPath = WebUtility.UrlDecode(path).Replace("\\", "/"); + var folderPath = WebUtility.UrlDecode(path).Replace("\\", "/"); // handle legacy path format folderPath = (folderPath == "/") ? "" : folderPath; if (!folderPath.EndsWith("/") && folderPath != "") { diff --git a/Oqtane.Shared/Models/User.cs b/Oqtane.Shared/Models/User.cs index 751b6e01..d7436b4c 100644 --- a/Oqtane.Shared/Models/User.cs +++ b/Oqtane.Shared/Models/User.cs @@ -97,7 +97,7 @@ namespace Oqtane.Models [NotMapped] public string FolderPath { - get => "Users\\" + UserId.ToString() + "\\"; + get => "Users/" + UserId.ToString() + "/"; } ///