start module output
This commit is contained in:
@@ -57,7 +57,7 @@ namespace zero.Web.Controllers
|
||||
/// <summary>
|
||||
/// Creates an edit model with appropriate options and permissions
|
||||
/// </summary>
|
||||
public JsonResult Edit<T>(T data, bool typed = true, Action<dynamic> transform = null) where T : IZeroEntity
|
||||
public JsonResult Edit<T>(T data, bool typed = true, Action<dynamic> transform = null) where T : IZeroIdEntity
|
||||
{
|
||||
Type type = typeof(T);
|
||||
bool canBeShared = AppAwareShareableType.IsAssignableFrom(type);
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using zero.Core.Api;
|
||||
using zero.Core.Entities;
|
||||
using zero.Core.Utils;
|
||||
|
||||
namespace zero.Web.Controllers
|
||||
{
|
||||
@@ -16,5 +19,17 @@ namespace zero.Web.Controllers
|
||||
public IActionResult GetModuleTypes() => Json(Api.GetModuleTypes());
|
||||
|
||||
public IActionResult GetModuleType([FromQuery] string alias) => Json(Api.GetModuleType(alias));
|
||||
|
||||
public IActionResult GetEmpty(string alias)
|
||||
{
|
||||
ModuleType moduleType = Api.GetModuleType(alias);
|
||||
IModule module = Activator.CreateInstance(moduleType.ContentType) as IModule;
|
||||
|
||||
module.ModuleTypeAlias = moduleType.Alias;
|
||||
module.Id = IdGenerator.Create(8);
|
||||
module.IsActive = true;
|
||||
|
||||
return Edit(module);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace zero.Web.Controllers
|
||||
ParentId = parent
|
||||
});
|
||||
|
||||
public async Task<IActionResult> GetRevisions([FromQuery] string id) => Json(await RevisionsApi.GetPaged<T>(id));
|
||||
public async Task<IActionResult> GetRevisions([FromQuery] string id, [FromQuery] int page = 1) => Json(await RevisionsApi.GetPaged<T>(id, page));
|
||||
|
||||
public async Task<IActionResult> Save([FromBody] T model) => Json(await Api.Save(model));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user