Fix aliases error when featuring
This commit is contained in:
@@ -13,6 +13,8 @@ import {
|
||||
import ExplicitIcon from '@mui/icons-material/Explicit'
|
||||
import {styled} from '@mui/material/styles'
|
||||
|
||||
import {getAlias} from '../../lib/utils/format'
|
||||
|
||||
const PREFIX = 'teks-kat'
|
||||
const IMAGE_URL = process.env.NEXT_PUBLIC_API_URL_ROOT || 'http://localhost:1337'
|
||||
|
||||
@@ -39,7 +41,7 @@ export default function TeksKat({parole}) {
|
||||
const {titre, artistes, annee, couverture, publishedAt, slug} = attributes
|
||||
|
||||
const datPiblikasyon = format(new Date(publishedAt), 'P', {locale: fr})
|
||||
const alias = artistes.data.map(({attributes}) => attributes.alias)
|
||||
const aliases = getAlias(artistes, attributes.prioriteArtistes)
|
||||
|
||||
const handleClick = slug => {
|
||||
router.push(`/paroles/${slug}#${slug}`).then(() => window.scrollTo(0, 0))
|
||||
@@ -76,7 +78,7 @@ export default function TeksKat({parole}) {
|
||||
)}
|
||||
</Typography>
|
||||
<Typography variant='body2' color='textSecondary' component='p'>
|
||||
{new Intl.ListFormat('fr').format(alias)}
|
||||
{aliases}
|
||||
</Typography>
|
||||
<Typography variant='body2' color='textSecondary' component='p'>
|
||||
{annee}
|
||||
|
||||
Reference in New Issue
Block a user