fix: date fetching only if needed
This commit is contained in:
parent
53c2ab6912
commit
24e6061002
1 changed files with 2 additions and 2 deletions
|
@ -112,7 +112,7 @@ const years = ref<Array<number>>([]);
|
||||||
const pagination = ref<Meta>({ page: 0, pageSize: 0, pageCount: 0, total: 0 });
|
const pagination = ref<Meta>({ page: 0, pageSize: 0, pageCount: 0, total: 0 });
|
||||||
const activeYear = ref<number>(0);
|
const activeYear = ref<number>(0);
|
||||||
|
|
||||||
if (props.data?.lookup.list_with_date) {
|
if (props.data?.lookup.list_with_date != "none") {
|
||||||
const { data: year } = await useAsyncData<Array<number>>("distinct-years", () =>
|
const { data: year } = await useAsyncData<Array<number>>("distinct-years", () =>
|
||||||
$fetch(`${baseUrl}/api/custom/${props.data?.lookup.collection}/distinct-years`)
|
$fetch(`${baseUrl}/api/custom/${props.data?.lookup.collection}/distinct-years`)
|
||||||
);
|
);
|
||||||
|
@ -121,7 +121,7 @@ if (props.data?.lookup.list_with_date) {
|
||||||
}
|
}
|
||||||
const { data: collections } = await useAsyncData("collection", () =>
|
const { data: collections } = await useAsyncData("collection", () =>
|
||||||
find<BaseCollection>(props.data?.lookup.collection ?? "", {
|
find<BaseCollection>(props.data?.lookup.collection ?? "", {
|
||||||
...(props.data?.lookup?.list_with_date
|
...(props.data?.lookup?.list_with_date != "none"
|
||||||
? {
|
? {
|
||||||
sort: "date:desc",
|
sort: "date:desc",
|
||||||
filters: {
|
filters: {
|
||||||
|
|
Loading…
Add table
Reference in a new issue