Merge pull request #3190 from sbwalker/dev
resolve #3189 - make path a querystring parameter
This commit is contained in:
commit
d4daf098e1
|
@ -29,7 +29,7 @@ namespace Oqtane.Services
|
||||||
public async Task<Folder> GetFolderAsync(int siteId, [NotNull] string folderPath)
|
public async Task<Folder> GetFolderAsync(int siteId, [NotNull] string folderPath)
|
||||||
{
|
{
|
||||||
var path = WebUtility.UrlEncode(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)
|
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)
|
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;
|
folderPath = (folderPath == "/") ? "" : folderPath;
|
||||||
if (!folderPath.EndsWith("/") && folderPath != "")
|
if (!folderPath.EndsWith("/") && folderPath != "")
|
||||||
{
|
{
|
||||||
|
|
|
@ -97,7 +97,7 @@ namespace Oqtane.Models
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public string FolderPath
|
public string FolderPath
|
||||||
{
|
{
|
||||||
get => "Users\\" + UserId.ToString() + "\\";
|
get => "Users/" + UserId.ToString() + "/";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user