This commit is contained in:
2021-01-27 19:47:25 +00:00
parent 44795034d7
commit c6cb6f2e45

View File

@@ -241,23 +241,24 @@ namespace AyaNova.Api.Controllers
[HttpGet("default/{dataListKey}")]
public ActionResult GetDefaultDataListView([FromRoute] string dataListKey)
{
if (!serverState.IsOpen)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
throw new System.NotSupportedException("NEEDS REPLACEMENT WITH NEW SYSTEM");
// if (!serverState.IsOpen)
// return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
//Instantiate the business object handler
DataListViewBiz biz = DataListViewBiz.GetBiz(ct, HttpContext);
// //Instantiate the business object handler
// DataListViewBiz biz = DataListViewBiz.GetBiz(ct, HttpContext);
if (!Authorized.HasReadFullRole(HttpContext.Items, biz.BizType))
return StatusCode(403, new ApiNotAuthorizedResponse());
// if (!Authorized.HasReadFullRole(HttpContext.Items, biz.BizType))
// return StatusCode(403, new ApiNotAuthorizedResponse());
if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState));
// 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));
// var o = AyaNova.DataList.DataListFactory.GetAyaDataList(dataListKey); ;
// if (o == null)
// return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
return Ok(ApiOkResponse.Response(o.DefaultListView));
// return Ok(ApiOkResponse.Response(o.DefaultListView));
}