mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-04 05:39:57 -05:00
Feature/archive search (#70)
* Working through archive search. * Using custom hook. * Setting archive.contents duration creation. * Archive search and domain list use custom hooks. * Watching search param using value, not history. * Search params are preserved on load. Search and domain can be cleared. * Fixing archive external link. * Archive search form is new generic SearchInput. * Reworking Archives empty states. * Simplifying Archives logic. * Fixing bug which displayed the wrong empty state during loading. * Archives can be synced and deleted. * Changing wording of archive delete. * Removing URL table. * Deleting domain if it has no archives. * Fixing FE use of archive.url. Fixing bug with get_domains. * Universal results are displayed on Welcome page. * Creating ExternalLink to open a link in a new tab.g * Increasing size of search headers. * Adding divider to ease reading. * Adding More button below search results. * Disabling More buttons when there are no results. * Ordering videos by rank so linked results are at the top. Signed-off-by: Roland <roland@learningselfreliance.com>
This commit is contained in:
parent
b594f9761a
commit
c23b014add
17 changed files with 666 additions and 904 deletions
|
|
@ -307,16 +307,11 @@ export async function deleteItems(itemIds) {
|
|||
await apiDelete(`${API_URI}/inventory/item/${i}`);
|
||||
}
|
||||
|
||||
export async function postArchive(url) {
|
||||
let i = {url: url};
|
||||
return await apiPost(`${API_URI}/archive`, i);
|
||||
}
|
||||
|
||||
export async function deleteArchive(archive_id) {
|
||||
return await apiDelete(`${API_URI}/archive/${archive_id}`);
|
||||
}
|
||||
|
||||
export async function searchArchives(offset, limit, domain = null) {
|
||||
export async function searchArchives(offset, limit, domain = null, searchStr = null) {
|
||||
// Build a search query to retrieve a list of videos from the API
|
||||
offset = offset || 0;
|
||||
limit = limit || DEFAULT_LIMIT;
|
||||
|
|
@ -324,6 +319,9 @@ export async function searchArchives(offset, limit, domain = null) {
|
|||
if (domain) {
|
||||
body['domain'] = domain;
|
||||
}
|
||||
if (searchStr) {
|
||||
body['search_str'] = searchStr;
|
||||
}
|
||||
|
||||
let response = await apiPost(`${ARCHIVES_API}/search`, body);
|
||||
if (response.status === 200) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue