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
+1 -1
View File
@@ -4,7 +4,7 @@ import Head from 'next/head'
import Navigasyon from './navigasyon'
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3000'
const apiUrl = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:1337'
const apiUrl = process.env.NEXT_PUBLIC_API_URL_ROOT || 'http://localhost:1337'
export default function HeadLayout({
children,
+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 (