tree fixes
This commit is contained in:
@@ -37,7 +37,7 @@ namespace zero.Core.Api
|
||||
|
||||
const string NEW_ID = "new:";
|
||||
|
||||
IBackofficeStore Backoffice;
|
||||
protected IBackofficeStore Backoffice { get; private set; }
|
||||
|
||||
|
||||
public BackofficeApi(IBackofficeStore store)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Raven.Client.Documents;
|
||||
using zero.Core.Options;
|
||||
|
||||
namespace zero.Core.Api
|
||||
{
|
||||
@@ -8,11 +9,14 @@ namespace zero.Core.Api
|
||||
|
||||
public IApplicationContext AppContext { get; private set; }
|
||||
|
||||
public IZeroOptions Options { get; private set; }
|
||||
|
||||
public BackofficeStore(IDocumentStore raven, IApplicationContext appContext)
|
||||
|
||||
public BackofficeStore(IDocumentStore raven, IApplicationContext appContext, IZeroOptions options)
|
||||
{
|
||||
Raven = raven;
|
||||
AppContext = appContext;
|
||||
Options = options;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,5 +26,7 @@ namespace zero.Core.Api
|
||||
IDocumentStore Raven { get; }
|
||||
|
||||
IApplicationContext AppContext { get; }
|
||||
|
||||
IZeroOptions Options { get; }
|
||||
}
|
||||
}
|
||||
@@ -14,19 +14,14 @@ namespace zero.Core.Api
|
||||
{
|
||||
public class PageTreeApi<T> : AppAwareBackofficeApi, IPageTreeApi<T> where T : IPage
|
||||
{
|
||||
protected IZeroOptions Options { get; private set; }
|
||||
|
||||
public PageTreeApi(IZeroOptions options, IBackofficeStore store) : base(store)
|
||||
{
|
||||
Options = options;
|
||||
}
|
||||
public PageTreeApi(IBackofficeStore store) : base(store) { }
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<IList<TreeItem>> GetChildren(string parentId = null, string activeId = null)
|
||||
{
|
||||
IList<TreeItem> items = new List<TreeItem>();
|
||||
IReadOnlyCollection<PageType> pageTypes = Options.Pages.GetAllItems();
|
||||
IReadOnlyCollection<PageType> pageTypes = Backoffice.Options.Pages.GetAllItems();
|
||||
string[] openIds = new string[0] { };
|
||||
|
||||
using (IAsyncDocumentSession session = Raven.OpenAsyncSession())
|
||||
|
||||
Reference in New Issue
Block a user