From 95de1fff6903bacb008a3bf5bc600c29a6001e22 Mon Sep 17 00:00:00 2001 From: sbwalker Date: Fri, 25 Aug 2023 09:49:07 -0400 Subject: [PATCH] resolve #3189 - make path a querystring parameter --- Oqtane.Client/Services/FolderService.cs | 2 +- Oqtane.Server/Controllers/FolderController.cs | 5 +++-- Oqtane.Shared/Models/User.cs | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) 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() + "/"; } ///