optimizations and fixes

This commit is contained in:
Shaun Walker
2020-03-11 14:39:49 -04:00
parent 2436f74830
commit fe98084324
23 changed files with 159 additions and 88 deletions

View File

@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Components;
using System.Collections.Generic;
using Oqtane.Shared;
using System;
using System.Net;
namespace Oqtane.Services
{
@ -44,6 +45,18 @@ namespace Oqtane.Services
return await _http.GetJsonAsync<Page>(apiurl + "/" + PageId.ToString() + "?userid=" + UserId.ToString());
}
public async Task<Page> GetPageAsync(string Path, int SiteId)
{
try
{
return await _http.GetJsonAsync<Page>(apiurl + "/path/" + SiteId.ToString() + "?path=" + WebUtility.UrlEncode(Path));
}
catch
{
return null;
}
}
public async Task<Page> AddPageAsync(Page Page)
{
return await _http.PostJsonAsync<Page>(apiurl, Page);