This commit is contained in:
2021-01-27 23:45:41 +00:00
parent 34a4c31249
commit 60586548e9
2 changed files with 71 additions and 81 deletions

View File

@@ -234,31 +234,30 @@ namespace AyaNova.Api.Controllers
}
/// <summary>
/// Get default ListView for DataList
/// Get default Columns and Sort for DataList
/// </summary>
/// <param name="dataListKey">Key of an existing DataList</param>
/// <returns>A single DataListSavedFilter</returns>
/// <returns>Columns and Sort</returns>
[HttpGet("default/{dataListKey}")]
public ActionResult GetDefaultDataListSavedFilter([FromRoute] string dataListKey)
{
throw new System.NotSupportedException("NEEDS REPLACEMENT WITH NEW SYSTEM");
// if (!serverState.IsOpen)
// return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
if (!serverState.IsOpen)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
// //Instantiate the business object handler
// DataListSavedFilterBiz biz = DataListSavedFilterBiz.GetBiz(ct, HttpContext);
//Instantiate the business object handler
DataListSavedFilterBiz biz = DataListSavedFilterBiz.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(new { Columns = o.DefaultColumns, SortBy = o.DefaultSortBy }));
}