mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-03 21:29:59 -05:00
Renaming all co-occurring to overlapping, easier to spell. Filtering by only overlapping tags when searching by a tag, this is because any non-overlapping will not produce results anyways.
This commit is contained in:
parent
3d74b4bcfc
commit
f59a4198d9
6 changed files with 203 additions and 83 deletions
|
|
@ -1487,12 +1487,17 @@ export async function getEvents(after) {
|
|||
return response
|
||||
}
|
||||
|
||||
export async function getTags() {
|
||||
const uri = `${API_URI}/tag`;
|
||||
export async function getTags(tagNames) {
|
||||
let uri = `${API_URI}/tag`;
|
||||
if (tagNames && tagNames.length > 0) {
|
||||
const params = new URLSearchParams();
|
||||
(typeof tagNames === 'string' ? [tagNames] : tagNames).forEach(name => params.append('tag_names', name));
|
||||
uri = `${uri}?${params.toString()}`;
|
||||
}
|
||||
const response = await apiGet(uri);
|
||||
if (response.ok) {
|
||||
const body = await response.json();
|
||||
return body['tags'];
|
||||
return body;
|
||||
}
|
||||
// Not toasting because this happens often.
|
||||
return response
|
||||
|
|
@ -1508,15 +1513,6 @@ export async function getRecentTags() {
|
|||
return [];
|
||||
}
|
||||
|
||||
export async function getCooccurringTags(tagName) {
|
||||
const uri = `${API_URI}/tag/cooccurring/${encodeURIComponent(tagName)}`;
|
||||
const response = await apiGet(uri);
|
||||
if (response.ok) {
|
||||
const body = await response.json();
|
||||
return body['tag_names'] || [];
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
export async function tagFileGroup(fileGroup, name) {
|
||||
const body = {tag_name: name};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue