Global search waits for selection before submitting.

This commit is contained in:
Roland 2024-01-01 15:16:03 -07:00
parent 377c69e8a7
commit 3ad7b8af00
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
9 changed files with 141 additions and 169 deletions

View file

@ -1003,36 +1003,23 @@ export async function fetchDecoded(vinNumber) {
}
}
export async function searchSuggestions(search_str) {
const body = {search_str: search_str};
export async function searchSuggestions(search_str, tagNames) {
const body = {search_str: search_str, tag_names: tagNames};
const response = await apiPost(`${API_URI}/search_suggestions`, body);
if (response.ok) {
const content = await response.json();
const fileGroups = content.file_groups;
const zimsEstimates = content.zims_estimates;
const channels = content.channels;
const domains = content.domains;
return {
fileGroups,
zimsEstimates,
channels,
domains,
}
}
}
export async function searchEstimateFiles(search_str, tagNames) {
const body = {search_str: search_str, tag_names: tagNames};
const response = await apiPost(`${API_URI}/files/search_estimates`, body);
if (response.ok) {
const content = await response.json();
return {
fileGroups: content.file_groups,
}
}
}
export async function searchEstimateZims(search_str, tagNames) {
const body = {search_str: search_str, tag_names: tagNames};
const response = await apiPost(`${API_URI}/zim/search_estimates`, body);