Enabled pagination on network page.
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
v-if="network"
|
||||
class="content"
|
||||
>
|
||||
<FilterBar :fetch-releases="fetchNetwork" />
|
||||
|
||||
<div
|
||||
class="network"
|
||||
:class="{ nosites: sites.length === 0 && networks.length === 0 }"
|
||||
@@ -89,6 +87,12 @@
|
||||
</div>
|
||||
|
||||
<div class="content-inner">
|
||||
<FilterBar
|
||||
:fetch-releases="fetchNetwork"
|
||||
:items-total="totalCount"
|
||||
:items-per-page="10"
|
||||
/>
|
||||
|
||||
<template v-if="sites.length > 0 || networks.length > 0">
|
||||
<span
|
||||
v-show="expanded"
|
||||
@@ -128,11 +132,16 @@ import Sites from '../sites/sites.vue';
|
||||
import Network from '../tile/network.vue';
|
||||
|
||||
async function fetchNetwork() {
|
||||
this.network = await this.$store.dispatch('fetchNetworkBySlug', {
|
||||
const { network, totalCount } = await this.$store.dispatch('fetchNetworkBySlug', {
|
||||
networkSlug: this.$route.params.networkSlug,
|
||||
limit: this.limit,
|
||||
range: this.$route.params.range,
|
||||
pageNumber: Number(this.$route.params.pageNumber),
|
||||
});
|
||||
|
||||
this.network = network;
|
||||
this.totalCount = totalCount;
|
||||
|
||||
if (this.network.studios) {
|
||||
this.studios = this.network.studios.map(studio => ({
|
||||
...studio,
|
||||
@@ -170,6 +179,8 @@ export default {
|
||||
networks: [],
|
||||
studios: [],
|
||||
releases: [],
|
||||
totalCount: null,
|
||||
limit: 10,
|
||||
pageTitle: null,
|
||||
expanded: false,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user