This commit is contained in:
2018-12-19 19:21:18 +00:00
parent c15d8277cb
commit 6c5b726210
3 changed files with 15 additions and 12 deletions

View File

@@ -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)
{

View File

@@ -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();
}
}