This commit is contained in:
@@ -47,22 +47,22 @@ namespace AyaNova.Api.Controllers
|
||||
/// Authorization varies list by list, will return 403 - Not Authorized if user has insufficient role
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="listOptions">List key, Paging, filtering and sorting options</param>
|
||||
/// <param name="tableRequest">List key, Paging, filtering and sorting options</param>
|
||||
/// <returns>Collection with paging data</returns>
|
||||
// [HttpPost("List", Name = nameof(List))]
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> List([FromBody] DataListTableOptions listOptions)
|
||||
public async Task<IActionResult> List([FromBody] DataListTableRequest tableRequest)
|
||||
{
|
||||
if (!serverState.IsOpen)
|
||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||
|
||||
if (listOptions.Limit == null || listOptions.Limit < 1)
|
||||
if (tableRequest.Limit == null || tableRequest.Limit < 1)
|
||||
{
|
||||
listOptions.Limit = DataListTableOptions.DefaultLimit;
|
||||
tableRequest.Limit = DataListTableOptions.DefaultLimit;
|
||||
}
|
||||
if (listOptions.Offset == null)
|
||||
if (tableRequest.Offset == null)
|
||||
{
|
||||
listOptions.Offset = 0;
|
||||
tableRequest.Offset = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace AyaNova.Api.Controllers
|
||||
|
||||
try
|
||||
{
|
||||
DataListReturnData r = await DataListFetcher.GetResponseAsync(ct, listOptions, UserRoles, log, UserId);
|
||||
DataListReturnData r = await DataListFetcher.GetResponseAsync(ct, tableRequest, UserRoles, log, UserId);
|
||||
return Ok(r);
|
||||
}
|
||||
catch (System.UnauthorizedAccessException)
|
||||
|
||||
Reference in New Issue
Block a user