diff --git a/front/src/components/favorites/List.vue b/front/src/components/favorites/List.vue index 9c2a17aa5..4644a8bb8 100644 --- a/front/src/components/favorites/List.vue +++ b/front/src/components/favorites/List.vue @@ -7,16 +7,15 @@ import { checkRedirectToLogin } from '~/utils' import TrackTable from '~/components/audio/track/Table.vue' import useLogger from '~/composables/useLogger' import useSharedLabels from '~/composables/locale/useSharedLabels' -import useOrdering from '~/composables/useOrdering' +import useOrdering, { OrderingProps } from '~/composables/useOrdering' import { onBeforeRouteUpdate, useRouter } from 'vue-router' import { computed, onMounted, reactive, ref, watch } from 'vue' import { useStore } from '~/store' import { Track } from '~/types' import { useGettext } from 'vue3-gettext' -import { OrderingField, RouteWithPreferences } from '~/store/ui' +import { OrderingField } from '~/store/ui' -interface Props { - orderingConfigName: RouteWithPreferences | null +interface Props extends OrderingProps { defaultPage?: number defaultPaginateBy?: number } diff --git a/front/src/components/library/Albums.vue b/front/src/components/library/Albums.vue index fea7d6f6c..8e884295a 100644 --- a/front/src/components/library/Albums.vue +++ b/front/src/components/library/Albums.vue @@ -5,18 +5,17 @@ import $ from 'jquery' import { onBeforeRouteUpdate, useRouter } from 'vue-router' import { computed, onMounted, reactive, ref, watch } from 'vue' import { useGettext } from 'vue3-gettext' -import { OrderingField, RouteWithPreferences } from '~/store/ui' +import { OrderingField } from '~/store/ui' import AlbumCard from '~/components/audio/album/Card.vue' import Pagination from '~/components/vui/Pagination.vue' import TagsSelector from '~/components/library/TagsSelector.vue' import useLogger from '~/composables/useLogger' import useSharedLabels from '~/composables/locale/useSharedLabels' -import useOrdering from '~/composables/useOrdering' +import useOrdering, { OrderingProps } from '~/composables/useOrdering' import { useStore } from '~/store' -interface Props { - orderingConfigName: RouteWithPreferences | null +interface Props extends OrderingProps { defaultPage?: number defaultPaginateBy?: number defaultQuery?: string @@ -61,11 +60,6 @@ const updateQueryString = () => router.replace({ } }) -const search = () => { - page.value = props.defaultPage - updateQueryString() -} - watch(page, updateQueryString) onOrderingUpdate(updateQueryString) @@ -128,7 +122,7 @@ const labels = computed(() => ({