LISTS WORKING cleanup afterwords
This commit is contained in:
@@ -1,18 +1,12 @@
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
using AyaNova.Models;
|
||||
using AyaNova.Api.ControllerHelpers;
|
||||
using AyaNova.Biz;
|
||||
|
||||
|
||||
namespace AyaNova.Api.Controllers
|
||||
{
|
||||
|
||||
@@ -59,9 +53,6 @@ namespace AyaNova.Api.Controllers
|
||||
//Instantiate the business object handler
|
||||
DataListSavedFilterBiz biz = DataListSavedFilterBiz.GetBiz(ct, HttpContext);
|
||||
|
||||
// if (!Authorized.HasReadFullRole(HttpContext.Items, biz.BizType))
|
||||
// return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
|
||||
if (!ModelState.IsValid)
|
||||
return BadRequest(new ApiErrorResponse(ModelState));
|
||||
|
||||
@@ -141,10 +132,7 @@ namespace AyaNova.Api.Controllers
|
||||
//Instantiate the business object handler
|
||||
DataListSavedFilterBiz biz = DataListSavedFilterBiz.GetBiz(ct, HttpContext);
|
||||
|
||||
// //check roles
|
||||
// if (!Authorized.HasCreateRole(HttpContext.Items, biz.BizType))
|
||||
// return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
|
||||
|
||||
if (!ModelState.IsValid)
|
||||
return BadRequest(new ApiErrorResponse(ModelState));
|
||||
|
||||
@@ -186,42 +174,13 @@ namespace AyaNova.Api.Controllers
|
||||
if (o == null)
|
||||
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
|
||||
|
||||
// if (!Authorized.HasDeleteRole(HttpContext.Items, biz.BizType))
|
||||
// return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
|
||||
if (!await biz.DeleteAsync(o))
|
||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
// /// <summary>
|
||||
// /// Get default Columns and Sort for DataList
|
||||
// /// </summary>
|
||||
// /// <param name="dataListKey">Key of an existing DataList</param>
|
||||
// /// <returns>Columns and Sort</returns>
|
||||
// [HttpGet("default/{dataListKey}")]
|
||||
// public ActionResult GetDefaultDataListSavedFilter([FromRoute] string dataListKey)
|
||||
// {
|
||||
// if (!serverState.IsOpen)
|
||||
// return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||
|
||||
// //Instantiate the business object handler
|
||||
// DataListSavedFilterBiz biz = DataListSavedFilterBiz.GetBiz(ct, HttpContext);
|
||||
|
||||
// if (!Authorized.HasReadFullRole(HttpContext.Items, biz.BizType))
|
||||
// return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
|
||||
// if (!ModelState.IsValid)
|
||||
// return BadRequest(new ApiErrorResponse(ModelState));
|
||||
|
||||
// var o = AyaNova.DataList.DataListFactory.GetAyaDataList(dataListKey); ;
|
||||
// if (o == null)
|
||||
// return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
|
||||
|
||||
// return Ok(ApiOkResponse.Response(new { Columns = o.DefaultColumns, SortBy = o.DefaultSortBy }));
|
||||
// }
|
||||
|
||||
|
||||
|
||||
//------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user