diff --git a/pages/paroles/[slug].js b/pages/paroles/[slug].js
index 4a91ad0..0c96970 100644
--- a/pages/paroles/[slug].js
+++ b/pages/paroles/[slug].js
@@ -1,15 +1,15 @@
import PropTypes from 'prop-types'
import {getAlias} from '../../lib/utils/format'
-import {jwennTeks, jwennKomanteEpiTeksId} from '../../lib/oki-api'
+import {jwennTeks} from '../../lib/oki-api'
-import TeksDrawer from '../../components/teks/teks-drawer'
import HeadLayout from '../../components/head-layout'
+import TeksDrawer from '../../components/teks/teks-drawer'
import Custom500 from '../500'
import Custom404 from '../404'
-export default function SlugTeks({hasError, errorMessage, paroles, parole, slug, commentaires}) {
+export default function SlugTeks({hasError, errorMessage, parole, slug}) {
if (hasError) {
console.log('⚠️ error :', errorMessage)
return
@@ -49,7 +49,7 @@ export default function SlugTeks({hasError, errorMessage, paroles, parole, slug,
imageMime={formatKouveti() ? formatKouveti().mime : null}
title={`${artistes} - ${parole.attributes.titre} | Paroles et Traductions`} tab={1} slug={`paroles/${slug}`}
>
-
+
)
}
@@ -60,13 +60,10 @@ export async function getServerSideProps({query}) {
let parole
let hasError
let errorMessage
- let commentaires
try {
paroles = await jwennTeks()
parole = paroles.find(({attributes}) => attributes.slug === slug)
- commentaires = paroles.map(({attributes}) => attributes.commentaires)
- commentaires = await jwennKomanteEpiTeksId(parole?.id)
} catch (error) {
errorMessage = error
hasError = true
@@ -78,8 +75,7 @@ export async function getServerSideProps({query}) {
errorMessage: errorMessage ? errorMessage.message : null,
paroles: paroles || null,
parole: parole || null,
- slug,
- commentaires: commentaires || null
+ slug
}
}
}
@@ -87,16 +83,12 @@ export async function getServerSideProps({query}) {
SlugTeks.defaultProps = {
hasError: null,
errorMessage: null,
- paroles: null,
- parole: null,
- commentaires: null
+ parole: null
}
SlugTeks.propTypes = {
hasError: PropTypes.bool,
errorMessage: PropTypes.string,
- paroles: PropTypes.array,
parole: PropTypes.object,
slug: PropTypes.string.isRequired,
- commentaires: PropTypes.array
}
diff --git a/pages/paroles/index.js b/pages/paroles/index.js
index ac56a58..667b890 100644
--- a/pages/paroles/index.js
+++ b/pages/paroles/index.js
@@ -1,13 +1,13 @@
import PropTypes from 'prop-types'
-import {jwennDenyeTeks, jwennTeks} from '../../lib/oki-api'
+import {jwennDenyeTeks} from '../../lib/oki-api'
-import TeksDrawer from '../../components/teks/teks-drawer'
import HeadLayout from '../../components/head-layout'
import Custom500 from '../500'
+import TeksDrawer from '../../components/teks/teks-drawer'
-export default function Teks({errorCode, errorMessage, paroles, denyeTeks}) {
+export default function Teks({errorCode, errorMessage, denyeTeks}) {
if (errorCode) {
console.log('⚠️ error', errorMessage)
return
@@ -15,19 +15,17 @@ export default function Teks({errorCode, errorMessage, paroles, denyeTeks}) {
return (
-
+
)
}
export async function getServerSideProps() {
- let paroles
let denyeTeks
let hasError
let errorMessage
try {
- paroles = await jwennTeks()
denyeTeks = await jwennDenyeTeks()
} catch (error) {
errorMessage = error.message
@@ -38,7 +36,6 @@ export async function getServerSideProps() {
props: {
errorCode: hasError || null,
errorMessage: errorMessage || null,
- paroles: paroles || null,
denyeTeks: denyeTeks || null
}
}
@@ -47,13 +44,11 @@ export async function getServerSideProps() {
Teks.defaultProps = {
errorCode: null,
errorMessage: null,
- paroles: null,
denyeTeks: null
}
Teks.propTypes = {
errorCode: PropTypes.bool,
errorMessage: PropTypes.string,
- paroles: PropTypes.array,
denyeTeks: PropTypes.array
}