This commit is contained in:
2020-03-16 22:32:28 +00:00
parent a5e805c858
commit fd63ad2320
2 changed files with 15 additions and 4 deletions

View File

@@ -73,16 +73,26 @@ namespace AyaNova.Biz
{
// split the query on space
var querySegments = AutoCompleteQuery.Split(' ');
if (querySegments.Length > 2)
{
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "query", "LT:PickListQueryInvalid");
return null;
}
// users may type several spaces in a regular query, so ignore that and only use the first two segments
if (querySegments[0].Contains(".."))
{
TagSpecificQuery = querySegments[0].Replace("..", "");
// the second string is considered the
AutoCompleteQuery = querySegments[1];
}
else if (querySegments[1].Contains(".."))
{
TagSpecificQuery = querySegments[1].Replace("..", "");
AutoCompleteQuery = querySegments[0];
}
else
{
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "query", "LT:PickListQueryInvalid");
return null;
}
}