Support for user personalizable pages

This commit is contained in:
Shaun Walker
2019-11-10 14:56:29 -05:00
parent ab564f7244
commit ffba735aac
17 changed files with 587 additions and 378 deletions

View File

@ -8,9 +8,10 @@ namespace Oqtane.Services
{
Task<List<Page>> GetPagesAsync(int SiteId);
Task<Page> GetPageAsync(int PageId);
Task<Page> GetPageAsync(int PageId, int UserId);
Task<Page> AddPageAsync(Page Page);
Task<Page> UpdatePageAsync(Page Page);
Task UpdatePageOrderAsync(int SiteId, int? ParentId);
Task UpdatePageOrderAsync(int SiteId, int PageId, int? ParentId);
Task DeletePageAsync(int PageId);
}
}

View File

@ -39,6 +39,11 @@ namespace Oqtane.Services
return await http.GetJsonAsync<Page>(apiurl + "/" + PageId.ToString());
}
public async Task<Page> GetPageAsync(int PageId, int UserId)
{
return await http.GetJsonAsync<Page>(apiurl + "/" + PageId.ToString() + "?userid=" + UserId.ToString());
}
public async Task<Page> AddPageAsync(Page Page)
{
return await http.PostJsonAsync<Page>(apiurl, Page);
@ -49,9 +54,9 @@ namespace Oqtane.Services
return await http.PutJsonAsync<Page>(apiurl + "/" + Page.PageId.ToString(), Page);
}
public async Task UpdatePageOrderAsync(int SiteId, int? ParentId)
public async Task UpdatePageOrderAsync(int SiteId, int PageId, int? ParentId)
{
await http.PutJsonAsync(apiurl + "/?siteid=" + SiteId.ToString() + "&parentid=" + ((ParentId == null) ? "" : ParentId.ToString()), null);
await http.PutJsonAsync(apiurl + "/?siteid=" + SiteId.ToString() + "&pageid=" + PageId.ToString() + "&parentid=" + ((ParentId == null) ? "" : ParentId.ToString()), null);
}
public async Task DeletePageAsync(int PageId)