mirror of
https://github.com/directus/directus.git
synced 2026-01-11 01:08:08 -05:00
Fix marketplace pagination not allowing partial pages (#22034)
This commit is contained in:
5
.changeset/weak-needles-film.md
Normal file
5
.changeset/weak-needles-film.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@directus/app': patch
|
||||
---
|
||||
|
||||
Fixed marketplace pagination not allowing partial pages and corrected TS type errors for search and type query parameters.
|
||||
@@ -19,8 +19,14 @@ const page = useRouteQuery('page', 1, {
|
||||
transform: (value) => Number(Array.isArray(value) ? value[0] : value) || 1,
|
||||
});
|
||||
|
||||
const search = useRouteQuery('search');
|
||||
const type = useRouteQuery('type');
|
||||
const search = useRouteQuery<string | null>('search', null, {
|
||||
transform: (value) => (Array.isArray(value) ? value[0] : value),
|
||||
});
|
||||
|
||||
const type = useRouteQuery<string | null>('type', null, {
|
||||
transform: (value) => (Array.isArray(value) ? value[0] : value),
|
||||
});
|
||||
|
||||
const sort = useRouteQuery<'popular' | 'recent' | 'downloads'>('sort', 'popular');
|
||||
|
||||
watch([search, sort, type], (newVal, oldVal) => {
|
||||
@@ -32,7 +38,7 @@ watch([search, sort, type], (newVal, oldVal) => {
|
||||
const filterCount = ref(0);
|
||||
|
||||
const extensions = ref<RegistryListResponse['data'] | null>(null);
|
||||
const pageCount = computed(() => Math.round(filterCount.value / perPage));
|
||||
const pageCount = computed(() => Math.ceil(filterCount.value / perPage));
|
||||
const loading = ref(false);
|
||||
const error = ref<unknown>(null);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user