Fix aliases error when featuring
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
import {getAlias} from '../../lib/utils/format'
|
||||
import {jwennTeks, jwennKomanteEpiTeksId} from '../../lib/oki-api'
|
||||
|
||||
import TeksDrawer from '../../components/teks/teks-drawer'
|
||||
@@ -8,11 +9,6 @@ import HeadLayout from '../../components/head-layout'
|
||||
import Custom500 from '../500'
|
||||
import Custom404 from '../404'
|
||||
|
||||
const jwennAwtis = artiste => {
|
||||
const alias = artiste.data.map(({attributes}) => attributes.alias)
|
||||
return new Intl.ListFormat('fr').format(alias)
|
||||
}
|
||||
|
||||
export default function SlugTeks({hasError, errorMessage, paroles, parole, slug, commentaires}) {
|
||||
if (hasError) {
|
||||
console.log('⚠️ error :', errorMessage)
|
||||
@@ -23,7 +19,7 @@ export default function SlugTeks({hasError, errorMessage, paroles, parole, slug,
|
||||
return <Custom404 />
|
||||
}
|
||||
|
||||
const artistes = parole.attributes.artistes.length === 1 ? parole.attributes.artistes[0].data.attributes.alias : jwennAwtis(parole.attributes.artistes)
|
||||
const artistes = parole.attributes.artistes.length === 1 ? parole.attributes.artistes[0].data.attributes.alias : getAlias(parole.attributes.artistes, parole.attributes.prioriteArtistes)
|
||||
const {couverture} = parole.attributes
|
||||
const formatKouveti = () => {
|
||||
if (!couverture?.data?.attributes) {
|
||||
|
||||
Reference in New Issue
Block a user