This commit is contained in:
@@ -47,9 +47,10 @@ namespace AyaNova.Api.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ayaType">The AyaType object type to select from</param>
|
/// <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="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>
|
/// <returns>Filtered list</returns>
|
||||||
[HttpGet("List")]
|
[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)
|
if (!serverState.IsOpen)
|
||||||
{
|
{
|
||||||
@@ -68,7 +69,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
|
|
||||||
var UserRoles = UserRolesFromContext.Roles(HttpContext.Items);
|
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)
|
if (o == null)
|
||||||
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
|
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
|
||||||
|
|
||||||
@@ -96,7 +97,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
var o = biz.GetListOfAllPickListTypes(TranslationId);
|
var o = biz.GetListOfAllPickListTypes(TranslationId);
|
||||||
if (o == null)
|
if (o == null)
|
||||||
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
|
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
|
||||||
|
|
||||||
return Ok(ApiOkResponse.Response(o, true));
|
return Ok(ApiOkResponse.Response(o, true));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
var PickList = PickListFactory.GetAyaPickList(ayaType);
|
||||||
@@ -55,7 +55,7 @@ namespace AyaNova.PickList
|
|||||||
|
|
||||||
//BUILD THE QUERY
|
//BUILD THE QUERY
|
||||||
|
|
||||||
var q = PickListSqlBuilder.Build(PickList, TemplateColumnNames, autoCompleteQuery);
|
var q = PickListSqlBuilder.Build(PickList, TemplateColumnNames, autoCompleteQuery, includeInactive);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -56,10 +56,10 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
|
|
||||||
//get picklist
|
//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;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user