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

View File

@@ -34,7 +34,7 @@ namespace AyaNova.PickList
List<string> TemplateColumnNames = PickList.GetFieldListFromTemplate(jTemplate);
//BUILD THE QUERY
var q = PickListSqlBuilder.Build(PickList, TemplateColumnNames, autoCompleteQuery, tagSpecificQuery, includeInactive);
var q = PickListSqlBuilder.Build(PickList, TemplateColumnNames, autoCompleteQuery, tagSpecificQuery, includeInactive, preId);
//RETURN OBJECTS
var ret = new List<NameIdActiveItem>();

View File

@@ -24,7 +24,7 @@ namespace AyaNova.PickList
const int MAXIMUM_RESULT_COUNT = 100;
//Build the query for a picklist request
internal static string Build(IAyaPickList pickList, List<string> templateColumnNames, string autoCompleteQuery, string tagSpecificQuery, bool IncludeInactive)
internal static string Build(IAyaPickList pickList, List<string> templateColumnNames, string autoCompleteQuery, string tagSpecificQuery, bool IncludeInactive, long preId)
{
//determine this in advance as it will be used in a loop later