This commit is contained in:
@@ -47,8 +47,8 @@ namespace AyaNova.Api.Controllers
|
||||
/// </summary>
|
||||
/// <param name="query">The query to filter the returned list by</param>
|
||||
/// <returns>List</returns>
|
||||
[HttpGet("list/{query}")]
|
||||
public ActionResult GetPickList([FromRoute]string query)
|
||||
[HttpGet("picklist")]
|
||||
public ActionResult GetPickList([FromQuery]string query)
|
||||
{
|
||||
if (!serverState.IsOpen)
|
||||
{
|
||||
|
||||
@@ -153,8 +153,17 @@ namespace AyaNova.Biz
|
||||
//going with contains for now as I think it's more useful in the long run and still captures startswith intent by user
|
||||
public static List<string> PickListFiltered(AyContext ct, string q)
|
||||
{
|
||||
q = NormalizeTag(q);
|
||||
return ct.Tag.Where(x => x.Name.Contains(q)).OrderBy(x => x.Name).Select(x => x.Name).ToList();
|
||||
//This path is intended for internal use and accepts that there may not be a filter specified
|
||||
//however the client will always require a filter to display a tag list for choosing from
|
||||
if (string.IsNullOrWhiteSpace(q))
|
||||
{
|
||||
return ct.Tag.OrderBy(x => x.Name).Select(x => x.Name).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
q = NormalizeTag(q);
|
||||
return ct.Tag.Where(x => x.Name.Contains(q)).OrderBy(x => x.Name).Select(x => x.Name).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user