Fix image url

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2022-05-20 04:40:17 +04:00
parent 07043945d6
commit a0ea1afaa3
2 changed files with 6 additions and 6 deletions
+5 -5
View File
@@ -26,23 +26,23 @@ export default function SlugTeks({hasError, errorMessage, paroles, parole, slug,
const artistes = parole.attributes.artistes.length === 1 ? parole.attributes.artistes[0].data.attributes.alias : jwennAwtis(parole.attributes.artistes)
const {couverture} = parole.attributes
const formatKouveti = () => {
if (!couverture) {
if (!couverture?.data?.attributes) {
return null
}
if (couverture && couverture.formats && couverture.formats.large) {
if (couverture.data.attributes && couverture.data.attributes.formats && couverture.data.attributes.formats.large) {
return couverture.formats.large
}
if (couverture && couverture.formats && couverture.formats.medium) {
if (couverture.data.attributes && couverture.data.attributes.formats && couverture.data.attributes.formats.medium) {
return couverture.formats.medium
}
if (couverture && couverture.formats && couverture.formats.small) {
if (couverture.data.attributes && couverture.data.attributes.formats && couverture.data.attributes.formats.small) {
return couverture.formats.small
}
return couverture
return couverture.data.attributes
}
return (