Only files that have been tagged will be returned when new 'Any' tag button is used to filter file search results.

This commit is contained in:
Roland 2024-07-22 16:36:57 -06:00
parent f3439c2bd5
commit 53d2402d32
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
31 changed files with 303 additions and 146 deletions

View file

@ -627,8 +627,8 @@ export async function deleteDownload(downloadId) {
}
}
export async function filesSearch(offset, limit, searchStr, mimetypes, model, tagNames, headline, months, fromYear, toYear) {
const body = {search_str: searchStr, offset: parseInt(offset), limit: parseInt(limit)};
export async function filesSearch(offset, limit, searchStr, mimetypes, model, tagNames, headline, months, fromYear, toYear, anyTag) {
const body = {search_str: searchStr, offset: parseInt(offset), limit: parseInt(limit), any_tag: anyTag};
if (mimetypes) {
body['mimetypes'] = mimetypes;
}
@ -1183,10 +1183,10 @@ export async function searchSuggestions(search_str) {
}
}
export async function searchEstimateFiles(search_str, tagNames, mimetypes, months, dateRange) {
export async function searchEstimateFiles(search_str, tagNames, mimetypes, months, dateRange, anyTag) {
months = months ? months.map(i => parseInt(i)) : [];
const body = {search_str, tag_names: tagNames, mimetypes, months};
const body = {search_str, tag_names: tagNames, mimetypes, months, any_tag: anyTag};
if (dateRange) {
body['from_year'] = dateRange[0];
body['to_year'] = dateRange[1];
@ -1198,6 +1198,8 @@ export async function searchEstimateFiles(search_str, tagNames, mimetypes, month
return {
fileGroups: content.file_groups,
}
} else {
console.error('Failed to get file search estimates!');
}
}