2020-09-17 14:10:12 -04:00
|
|
|
<script>
|
|
|
|
import { mapActions, mapState } from 'vuex';
|
|
|
|
import { historyPushState, buildUrlWithCurrentLocation } from '~/lib/utils/common_utils';
|
2021-02-14 13:09:20 -05:00
|
|
|
import TablePagination from '~/vue_shared/components/pagination/table_pagination.vue';
|
2020-09-17 14:10:12 -04:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'ReleasesPaginationRest',
|
|
|
|
components: { TablePagination },
|
|
|
|
computed: {
|
2020-09-18 11:09:22 -04:00
|
|
|
...mapState('list', ['restPageInfo']),
|
2020-09-17 14:10:12 -04:00
|
|
|
},
|
|
|
|
methods: {
|
2020-09-18 11:09:22 -04:00
|
|
|
...mapActions('list', ['fetchReleases']),
|
2020-09-17 14:10:12 -04:00
|
|
|
onChangePage(page) {
|
|
|
|
historyPushState(buildUrlWithCurrentLocation(`?page=${page}`));
|
2020-09-18 11:09:22 -04:00
|
|
|
this.fetchReleases({ page });
|
2020-09-17 14:10:12 -04:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2020-09-18 11:09:22 -04:00
|
|
|
<table-pagination :change="onChangePage" :page-info="restPageInfo" />
|
2020-09-17 14:10:12 -04:00
|
|
|
</template>
|