mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Tag select refactor (#4478)
* Add interface to load tags by id * Use minimal data for tag select queries * Center image/text in select list * Overhaul tag select * Support excludeIds. Comment out image in dropdown * Replace existing selects * Remove unused code * Fix styling of aliases
This commit is contained in:
@@ -344,7 +344,22 @@ export const queryFindTags = (filter: ListFilterModel) =>
|
||||
},
|
||||
});
|
||||
|
||||
export const useAllTagsForFilter = () => GQL.useAllTagsForFilterQuery();
|
||||
export const queryFindTagsByIDForSelect = (tagIDs: number[]) =>
|
||||
client.query<GQL.FindTagsForSelectQuery>({
|
||||
query: GQL.FindTagsForSelectDocument,
|
||||
variables: {
|
||||
ids: tagIDs,
|
||||
},
|
||||
});
|
||||
|
||||
export const queryFindTagsForSelect = (filter: ListFilterModel) =>
|
||||
client.query<GQL.FindTagsForSelectQuery>({
|
||||
query: GQL.FindTagsForSelectDocument,
|
||||
variables: {
|
||||
filter: filter.makeFindFilter(),
|
||||
tag_filter: filter.makeFilter(),
|
||||
},
|
||||
});
|
||||
|
||||
export const useFindSavedFilter = (id: string) =>
|
||||
GQL.useFindSavedFilterQuery({
|
||||
@@ -1598,8 +1613,6 @@ export const useTagCreate = () =>
|
||||
const tag = result.data?.tagCreate;
|
||||
if (!tag) return;
|
||||
|
||||
appendObject(cache, tag, GQL.AllTagsForFilterDocument);
|
||||
|
||||
// update stats
|
||||
updateStats(cache, "tag_count", 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user