Fixed showcase in stash. Applying tag filter to tag list.
This commit is contained in:
@@ -14,6 +14,7 @@ export async function onBeforeRender(pageContext) {
|
||||
scope: pageContext.routeParams.scope || 'stashed',
|
||||
stashId: stash.id,
|
||||
tagFilter: pageContext.tagFilter,
|
||||
isShowcased: null,
|
||||
}), {
|
||||
page: Number(pageContext.routeParams.page) || 1,
|
||||
limit: Number(pageContext.urlParsed.search.limit) || 30,
|
||||
|
||||
@@ -116,9 +116,10 @@ const tagSlugs = {
|
||||
],
|
||||
};
|
||||
|
||||
export async function onBeforeRender(_pageContext) {
|
||||
export async function onBeforeRender(pageContext) {
|
||||
const tags = await fetchTagsById(Object.values(tagSlugs).flat());
|
||||
const tagsBySlug = Object.fromEntries(tags.map((tag) => [tag.slug, tag]));
|
||||
const filteredTags = tags.filter((tag) => !pageContext.tagFilter.includes(tag.name) && !pageContext.tagFilter.includes(tag.slug));
|
||||
const tagsBySlug = Object.fromEntries(filteredTags.map((tag) => [tag.slug, tag]));
|
||||
|
||||
const tagShowcase = Object.fromEntries(Object.entries(tagSlugs).map(([category, categorySlugs]) => [
|
||||
category,
|
||||
|
||||
Reference in New Issue
Block a user