Skip to content

Commit

Permalink
fix: Виправлено навігацію по таксономіям
Browse files Browse the repository at this point in the history
  • Loading branch information
cawa-93 committed Sep 12, 2022
1 parent a1748d3 commit 4bbeff0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions components/Feed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
import {FeedArt, FeedComics, FeedFanfic, FeedItem} from "#components";
import {queryContent, useAsyncData, useRoute} from "#imports";
import {useTerm} from "~/composables/useTerm";
import {callWithNuxt} from "#app";
const route = useRoute();
const nuxtApp = useNuxtApp();
const query = (Array.isArray(route.params?.query) ? route.params.query : [route.params?.query]).filter(q => !!q?.trim());
Expand All @@ -15,14 +17,15 @@ const {data: posts} = await useAsyncData(`content-${route.fullPath}`, async () =
if (isTaxonomy(type)) {
const term = await useTerm({type, slug})
// console.log({term})
const posts = await queryContent().where({
/**
* WORKAROUND
* @see https://github.com/nuxt/content/issues/1510#issuecomment-1243620985
*/
return callWithNuxt(nuxtApp, () => queryContent().where({
[type]: {
$contains: term.title!
}
}).find()
console.log(route.fullPath, posts.length)
return posts
}).find())
}
return queryContent(type || '').where({
Expand Down

0 comments on commit 4bbeff0

Please sign in to comment.