resolve #3189 - make path a querystring parameter
This commit is contained in:
parent
4de809e275
commit
95de1fff69
|
@ -29,7 +29,7 @@ namespace Oqtane.Services
|
|||
public async Task<Folder> GetFolderAsync(int siteId, [NotNull] string folderPath)
|
||||
{
|
||||
var path = WebUtility.UrlEncode(folderPath);
|
||||
return await GetJsonAsync<Folder>($"{ApiUrl}/{siteId}/{path}");
|
||||
return await GetJsonAsync<Folder>($"{ApiUrl}/path/{siteId}/?path={path}");
|
||||
}
|
||||
|
||||
public async Task<Folder> AddFolderAsync(Folder folder)
|
||||
|
|
|
@ -84,10 +84,11 @@ namespace Oqtane.Controllers
|
|||
}
|
||||
}
|
||||
|
||||
[HttpGet("{siteId}/{path}")]
|
||||
// GET api/<controller>/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 != "")
|
||||
{
|
||||
|
|
|
@ -97,7 +97,7 @@ namespace Oqtane.Models
|
|||
[NotMapped]
|
||||
public string FolderPath
|
||||
{
|
||||
get => "Users\\" + UserId.ToString() + "\\";
|
||||
get => "Users/" + UserId.ToString() + "/";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue
Block a user