This commit is contained in:
2020-03-23 20:00:16 +00:00
parent cb08a727fa
commit 7e361d3f41
3 changed files with 6 additions and 4 deletions

View File

@@ -58,7 +58,7 @@ namespace AyaNova.Api.Controllers
/// <param name="preId">Return only one item (for pre-selected items on forms) </param>
/// <returns>Filtered list</returns>
[HttpGet("List")]
public async Task<IActionResult> GetList([FromQuery]AyaType ayaType, [FromQuery]string query, [FromQuery] bool inactive, [FromQuery]long preId)
public async Task<IActionResult> GetList([FromQuery]AyaType ayaType, [FromQuery]string query, [FromQuery] bool inactive, [FromQuery]long? preId)
{
if (!serverState.IsOpen)
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
@@ -81,7 +81,9 @@ namespace AyaNova.Api.Controllers
//Instantiate the business object handler
PickListBiz biz = PickListBiz.GetBiz(ct, HttpContext);
var o = await biz.GetPickListAsync(PickList, query, inactive, preId, log);
if (preId == null)
preId = 0;
var o = await biz.GetPickListAsync(PickList, query, inactive, (long)preId, log);
if (o == null)
return BadRequest(new ApiErrorResponse(biz.Errors));
else