fixed job details search bar when empty input or duplicate input

This commit is contained in:
Haokun-Chen 2018-06-06 14:29:32 -04:00
parent 431ee9bbbf
commit 6b1129ce1d

View File

@ -64,9 +64,21 @@ function removeSearchTag (index) {
}
function submitSearch () {
// empty input, not submit new search, return.
if (!vm.value) {
return;
}
const currentQueryset = getCurrentQueryset();
// check duplicate , see if search input already exists in current search tags
if (currentQueryset.search) {
if (currentQueryset.search.includes(vm.value)) {
return;
}
}
const searchInputQueryset = qs.getSearchInputQueryset(vm.value, isFilterable);
const modifiedQueryset = qs.mergeQueryset(currentQueryset, searchInputQueryset);
reloadQueryset(modifiedQueryset, strings.get('search.REJECT_INVALID'));