diff --git a/components/head-layout.js b/components/head-layout.js index 8fd6382..a1289ff 100644 --- a/components/head-layout.js +++ b/components/head-layout.js @@ -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, diff --git a/pages/paroles/[slug].js b/pages/paroles/[slug].js index d3f595f..5993884 100644 --- a/pages/paroles/[slug].js +++ b/pages/paroles/[slug].js @@ -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 (