mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-30 03:46:29 -05:00
Splitting FileGroups from search suggestions to speed up channel/domain response time.
This commit is contained in:
parent
65f94b4807
commit
969a065a6c
6 changed files with 102 additions and 52 deletions
|
|
@ -1061,7 +1061,20 @@ export async function fetchDecoded(vinNumber) {
|
|||
}
|
||||
}
|
||||
|
||||
export async function searchSuggestions(search_str, tagNames, mimetypes, months, dateRange) {
|
||||
export async function searchSuggestions(search_str) {
|
||||
const body = {search_str};
|
||||
const response = await apiPost(`${API_URI}/search_suggestions`, body);
|
||||
if (response.ok) {
|
||||
const content = await response.json();
|
||||
|
||||
return {
|
||||
channels: content.channels,
|
||||
domains: content.domains,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function searchEstimateFiles(search_str, tagNames, mimetypes, months, dateRange) {
|
||||
months = months ? months.map(i => parseInt(i)) : [];
|
||||
|
||||
const body = {search_str, tag_names: tagNames, mimetypes, months};
|
||||
|
|
@ -1069,17 +1082,12 @@ export async function searchSuggestions(search_str, tagNames, mimetypes, months,
|
|||
body['from_year'] = dateRange[0];
|
||||
body['to_year'] = dateRange[1];
|
||||
}
|
||||
const response = await apiPost(`${API_URI}/search_suggestions`, body);
|
||||
const response = await apiPost(`${API_URI}/search_file_estimates`, body);
|
||||
if (response.ok) {
|
||||
const content = await response.json();
|
||||
|
||||
const fileGroups = content.file_groups;
|
||||
const channels = content.channels;
|
||||
const domains = content.domains;
|
||||
return {
|
||||
fileGroups,
|
||||
channels,
|
||||
domains,
|
||||
fileGroups: content.file_groups,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue