Fixed showcase in stash. Applying tag filter to tag list.

This commit is contained in:
2024-04-03 03:31:35 +02:00
parent 5525284818
commit 0b37d2dd1a
4 changed files with 6 additions and 4 deletions

View File

@@ -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,

View File

@@ -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,