This commit is contained in:
2020-03-13 19:32:34 +00:00
parent 75b18e0f0e
commit 02cdaa1346
3 changed files with 8 additions and 7 deletions

View File

@@ -47,9 +47,10 @@ namespace AyaNova.Api.Controllers
/// </summary>
/// <param name="ayaType">The AyaType object type to select from</param>
/// <param name="query">The query to filter the returned list by</param>
/// <param name="inactive">Include inactive objects in the returned list</param>
/// <returns>Filtered list</returns>
[HttpGet("List")]
public async Task<IActionResult> GetList([FromQuery]AyaType ayaType, [FromQuery]string query)
public async Task<IActionResult> GetList([FromQuery]AyaType ayaType, [FromQuery]string query, [FromQuery] bool inactive)
{
if (!serverState.IsOpen)
{
@@ -68,7 +69,7 @@ namespace AyaNova.Api.Controllers
var UserRoles = UserRolesFromContext.Roles(HttpContext.Items);
var o = await biz.GetPickListAsync(ayaType, query, UserRoles);
var o = await biz.GetPickListAsync(ayaType, query, inactive, UserRoles);
if (o == null)
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
@@ -96,7 +97,7 @@ namespace AyaNova.Api.Controllers
var o = biz.GetListOfAllPickListTypes(TranslationId);
if (o == null)
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
return Ok(ApiOkResponse.Response(o, true));
}

View File

@@ -17,7 +17,7 @@ namespace AyaNova.PickList
{
internal static async Task<List<NameIdActiveItem>> GetResponseAsync(AyaType ayaType, string autoCompleteQuery, AyContext ct, AuthorizationRoles userRoles)
internal static async Task<List<NameIdActiveItem>> GetResponseAsync(AyaType ayaType, string autoCompleteQuery, bool includeInactive, AyContext ct, AuthorizationRoles userRoles)
{
var PickList = PickListFactory.GetAyaPickList(ayaType);
@@ -55,7 +55,7 @@ namespace AyaNova.PickList
//BUILD THE QUERY
var q = PickListSqlBuilder.Build(PickList, TemplateColumnNames, autoCompleteQuery);
var q = PickListSqlBuilder.Build(PickList, TemplateColumnNames, autoCompleteQuery, includeInactive);

View File

@@ -56,10 +56,10 @@ namespace AyaNova.Biz
//get picklist
internal async Task<List<NameIdActiveItem>> GetPickListAsync(AyaType ayaType, string query, AuthorizationRoles userRoles)
internal async Task<List<NameIdActiveItem>> GetPickListAsync(AyaType ayaType, string query, bool inactive, AuthorizationRoles userRoles)
{
List<NameIdActiveItem> items = await PickListFetcher.GetResponseAsync(ayaType, query, ct, userRoles);
List<NameIdActiveItem> items = await PickListFetcher.GetResponseAsync(ayaType, query, inactive, ct, userRoles);
return items;
}