Added pagination size

This commit is contained in:
Damien Broqua 2024-02-01 08:47:33 +01:00
parent d4e6d23459
commit bf2e9be3b7
11 changed files with 54 additions and 17 deletions

View file

@ -7,8 +7,8 @@ Vue.createApp({
total: 0,
// eslint-disable-next-line no-undef
page: query.page || 1,
limit: 16,
totalPages: 1,
limit: 24,
artist: "",
format: "",
year: "",
@ -69,7 +69,7 @@ Vue.createApp({
this.sortOrder = `${sortOrder.sort}-${sortOrder.order}`;
let url = `/api/v1/albums?page=${this.page}&limit=${this.limit}&sort=${this.sort}&order=${this.order}`;
let url = `/api/v1/albums?page=${this.page}&sort=${this.sort}&order=${this.order}`;
if (this.artist) {
url += `&artist=${this.formatParams(this.artist)}`;
}
@ -94,6 +94,7 @@ Vue.createApp({
.get(url)
.then((response) => {
this.items = response.data.rows;
this.limit = response.data.limit;
this.total = response.data.count || 0;
this.totalPages =
parseInt(response.data.count / this.limit, 10) +