This commit is contained in:
2020-01-17 22:05:49 +00:00
parent fb0f64ef1e
commit 0866c7112d
3 changed files with 133 additions and 124 deletions

View File

@@ -84,31 +84,32 @@ namespace AyaNova.Api.Controllers
}
/// <summary>
/// Get list for selection / viewing
///
/// Required roles: Any (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));
//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 (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));
// string ret= biz.GetList(Url, nameof(List), pagingOptions).Result;
// return Ok(ret);
}
// ApiPagedResponse pr = biz.GetList(Url, nameof(List), pagingOptions).Result;
// return Ok(new ApiOkWithPagingResponse(pr));
// // string ret= biz.GetList(Url, nameof(List), pagingOptions).Result;
// // return Ok(ret);
// }
/// <summary>
/// TEST list with relationships