diff --git a/front/src/components/audio/ChannelsWidget.vue b/front/src/components/audio/ChannelsWidget.vue index aa90a363b..dd9a2be06 100644 --- a/front/src/components/audio/ChannelsWidget.vue +++ b/front/src/components/audio/ChannelsWidget.vue @@ -3,15 +3,15 @@ import type { BackendError, BackendResponse, Channel } from '~/types' import { ref, onMounted, watch, reactive } from 'vue' import { clone } from 'lodash-es' -import { useI18n } from 'vue-i18n' import axios from 'axios' +import usePage from '~/composables/navigation/usePage' + import ChannelCard from '~/components/audio/ChannelCard.vue' -import Layout from '~/components/ui/Layout.vue' import Loader from '~/components/ui/Loader.vue' -import Button from '~/components/ui/Button.vue' -import Spacer from '../ui/Spacer.vue' +import Section from '~/components/ui/Section.vue' +import Pagination from '~/components/ui/Pagination.vue' interface Events { (e: 'fetched', channels: BackendResponse): void @@ -19,19 +19,19 @@ interface Events { interface Props { filters: object - limit?: number + limit?: number, + title?: string, } -const { t } = useI18n() - const emit = defineEmits() const props = withDefaults(defineProps(), { - limit: 5 + limit: 5, }) const channels = reactive([] as Channel[]) const errors = ref([] as string[]) const nextPage = ref() +const page = usePage() const count = ref(0) const isLoading = ref(false) @@ -41,8 +41,8 @@ const fetchData = async (url = 'channels/') => { const params = { ...clone(props.filters), - page_size: props.limit, - include_channels: true + page: page.value, + page_size: props.limit } try { @@ -62,41 +62,30 @@ onMounted(() => { fetchData() }) -watch(() => props.filters, () => { +watch(() => [props.filters, page], () => { fetchData() }, { deep: true }) diff --git a/front/src/components/library/Home.vue b/front/src/components/library/Home.vue index 12b1f29e4..784208a6a 100644 --- a/front/src/components/library/Home.vue +++ b/front/src/components/library/Home.vue @@ -81,10 +81,8 @@ fetchData() :show-modification-date="true" :filters="{ordering: '-creation_date'}" :limit="12" + :title="t('components.library.Home.header.newChannels')" > - @@ -143,7 +143,7 @@ const showCreateModal = ref(false) />