This commit is contained in:
2020-01-21 23:39:24 +00:00
parent 8b8824cabb
commit 95e6acc178
3 changed files with 70 additions and 71 deletions

View File

@@ -84,57 +84,57 @@ namespace AyaNova.Api.Controllers
}
//COMMENTED OUT, FOR NOW UNTIL I GET THE FULLY WORKING TEST LIST BELOW THEN COME BACK AND LOOK AT THIS
/// <summary>
/// Get list for selection / viewing
///
/// Required roles: Any in-house staff (some roles might have restrictions on exact fields that are returned)
///
/// </summary>
/// <param name="pagingOptions">Paging, filtering and sorting options</param>
/// <returns>Collection with paging data</returns>
[HttpGet("List", Name = nameof(List))]
public ActionResult List([FromQuery] ListOptions pagingOptions)
{
if (serverState.IsClosed)
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
// /// <summary>
// /// Get list for selection / viewing
// ///
// /// Required roles: Any in-house staff (some roles might have restrictions on exact fields that are returned)
// ///
// /// </summary>
// /// <param name="pagingOptions">Paging, filtering and sorting options</param>
// /// <returns>Collection with paging data</returns>
// [HttpGet("List", Name = nameof(List))]
// public ActionResult List([FromQuery] ListOptions pagingOptions)
// {
// if (serverState.IsClosed)
// return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState));
// if (!ModelState.IsValid)
// return BadRequest(new ApiErrorResponse(ModelState));
//Instantiate the business object handler
WidgetBiz biz = WidgetBiz.GetBiz(ct, HttpContext);
// //Instantiate the business object handler
// WidgetBiz biz = WidgetBiz.GetBiz(ct, HttpContext);
ApiPagedResponse pr = biz.GetList(Url, nameof(List), pagingOptions).Result;
return Ok(new ApiOkWithPagingResponse(pr));
// ApiPagedResponse pr = biz.GetList(Url, nameof(List), pagingOptions).Result;
// return Ok(new ApiOkWithPagingResponse(pr));
}
// }
/// <summary>
/// TEST list with relationships
///
/// Required roles: Any in-house staff (some roles might have restrictions on exact fields that are returned)
///
/// </summary>
/// <param name="pagingOptions">Paging, filtering and sorting options</param>
/// <returns>Collection with paging data</returns>
[HttpGet("TestGetWidgetUserEmailList", Name = nameof(TestGetWidgetUserEmailList))]
public ActionResult TestGetWidgetUserEmailList([FromQuery] ListOptions pagingOptions)
{
if (serverState.IsClosed)
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
// /// <summary>
// /// TEST list with relationships
// ///
// /// Required roles: Any in-house staff (some roles might have restrictions on exact fields that are returned)
// ///
// /// </summary>
// /// <param name="pagingOptions">Paging, filtering and sorting options</param>
// /// <returns>Collection with paging data</returns>
// [HttpGet("TestGetWidgetUserEmailList", Name = nameof(TestGetWidgetUserEmailList))]
// public ActionResult TestGetWidgetUserEmailList([FromQuery] ListOptions pagingOptions)
// {
// if (serverState.IsClosed)
// return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState));
// if (!ModelState.IsValid)
// return BadRequest(new ApiErrorResponse(ModelState));
//Instantiate the business object handler
WidgetBiz biz = WidgetBiz.GetBiz(ct, HttpContext);
// //Instantiate the business object handler
// WidgetBiz biz = WidgetBiz.GetBiz(ct, HttpContext);
ApiPagedResponse pr = biz.TestGetWidgetUserEmailList(Url, nameof(TestGetWidgetUserEmailList), pagingOptions).Result;
return Ok(new ApiOkWithPagingResponse(pr));
// string ret= biz.GetList(Url, nameof(List), pagingOptions).Result;
// return Ok(ret);
}
// ApiPagedResponse pr = biz.TestGetWidgetUserEmailList(Url, nameof(TestGetWidgetUserEmailList), pagingOptions).Result;
// return Ok(new ApiOkWithPagingResponse(pr));
// // string ret= biz.GetList(Url, nameof(List), pagingOptions).Result;
// // return Ok(ret);
// }