#62 - Échaper les & dans les urls des pages

This commit is contained in:
Damien Broqua 2022-09-14 14:30:27 +02:00
parent 6454f5f8d6
commit 4da4dd9423
2 changed files with 8 additions and 8 deletions

View File

@ -196,19 +196,19 @@
let url = `/api/v1/albums?userId=${this.userId}&page=${this.page}&limit=${this.limit}&sort=${this.sort}&order=${this.order}`; let url = `/api/v1/albums?userId=${this.userId}&page=${this.page}&limit=${this.limit}&sort=${this.sort}&order=${this.order}`;
if ( this.artist ) { if ( this.artist ) {
url += `&artists_sort=${this.artist}`; url += `&artists_sort=${this.artist.replace('&', '%26')}`;
} }
if ( this.format ) { if ( this.format ) {
url += `&format=${this.format}`; url += `&format=${this.format.replace('&', '%26')}`;
} }
if ( this.year ) { if ( this.year ) {
url += `&year=${this.year}`; url += `&year=${this.year}`;
} }
if ( this.genre ) { if ( this.genre ) {
url += `&genre=${this.genre}`; url += `&genre=${this.genre.replace('&', '%26')}`;
} }
if ( this.style ) { if ( this.style ) {
url += `&style=${this.style}`; url += `&style=${this.style.replace('&', '%26')}`;
} }
axios.get(url) axios.get(url)

View File

@ -250,19 +250,19 @@
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}&limit=${this.limit}&sort=${this.sort}&order=${this.order}`;
if ( this.artist ) { if ( this.artist ) {
url += `&artists_sort=${this.artist}`; url += `&artists_sort=${this.artist.replace('&', '%26')}`;
} }
if ( this.format ) { if ( this.format ) {
url += `&format=${this.format}`; url += `&format=${this.format.replace('&', '%26')}`;
} }
if ( this.year ) { if ( this.year ) {
url += `&year=${this.year}`; url += `&year=${this.year}`;
} }
if ( this.genre ) { if ( this.genre ) {
url += `&genre=${this.genre}`; url += `&genre=${this.genre.replace('&', '%26')}`;
} }
if ( this.style ) { if ( this.style ) {
url += `&style=${this.style}`; url += `&style=${this.style.replace('&', '%26')}`;
} }
axios.get(url) axios.get(url)