change: loading performance

This commit is contained in:
Julian Krauser 2025-05-10 17:37:58 +02:00
parent 7c8be0ccb9
commit 716b5535ae
14 changed files with 129 additions and 98 deletions

View file

@ -25,7 +25,7 @@ import type SharedEmphasiseArticle from "../../types/component/shared/emphasiseA
import type Lookup from "../../types/collection/lookup";
const { find } = useStrapi();
const { data: lookup } = await useAsyncData("lookup", () =>
const { data: lookup } = await useAsyncData(() =>
find<Lookup>("collection-lookups", {
filters: {
collection: "articles",

View file

@ -113,13 +113,13 @@ const pagination = ref<Meta>({ page: 0, pageSize: 0, pageCount: 0, total: 0 });
const activeYear = ref<number>(0);
if (props.data?.lookup.list_with_date != "none") {
const { data: year } = await useAsyncData<Array<number>>("distinct-years", () =>
const { data: year } = await useAsyncData<Array<number>>(() =>
$fetch(`${baseUrl}/api/custom/${props.data?.lookup.collection}/distinct-years`)
);
years.value = year.value ?? [];
activeYear.value = years.value[0] ?? 0;
}
const { data: collections } = await useAsyncData("collection", () =>
const { data: collections } = await useAsyncData(() =>
find<BaseCollection>(props.data?.lookup.collection ?? "", {
...(props.data?.lookup?.list_with_date != "none"
? {
@ -235,7 +235,7 @@ async function changeTimedData(year: number) {
withCount: true,
},
});
console.log(data);
collection.value = data?.data;
pagination.value = (data?.meta.pagination as unknown as {
page: number;