feat: add jwennAnVedette
Déploiement FRONT PROD / check (push) Successful in 2m2s
Déploiement FRONT PROD / deploy (push) Successful in 20s

This commit is contained in:
2026-06-17 08:51:06 +04:00
parent a89196909e
commit ed819e3537
2 changed files with 22 additions and 3 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
import Box from '@mui/material/Box' import Box from '@mui/material/Box'
import Container from '@mui/material/Container' import Container from '@mui/material/Container'
import {notFound} from 'next/navigation' import {notFound} from 'next/navigation'
import {jwennStats, jwennDenyeTeks} from '../lib/oki-api' import {jwennStats, jwennDenyeTeks, jwennAnVedette} from '../lib/oki-api'
import Statistik from '../components/akey/statistik' import Statistik from '../components/akey/statistik'
import Akey from '../components/akey' import Akey from '../components/akey'
@@ -12,13 +12,13 @@ import Footer from '../components/footer'
import Aso from '../components/akey/aso' import Aso from '../components/akey/aso'
async function jwennDone() { async function jwennDone() {
const [statistik, denyeTeks] = await Promise.all([jwennStats(), jwennDenyeTeks()]) const [statistik, denyeTeks, anVedette] = await Promise.all([jwennStats(), jwennDenyeTeks(), jwennAnVedette()])
if (!statistik) { if (!statistik) {
notFound() notFound()
} }
return {statistik, dernierTeks: denyeTeks?.[0]} return {statistik, dernierTeks: anVedette ?? denyeTeks?.[0]}
} }
export default async function Page() { export default async function Page() {
+19
View File
@@ -229,6 +229,25 @@ export async function jwennDenyeTeks() {
return data return data
} }
export async function jwennAnVedette() {
const query = qs.stringify({
populate: ['artistes', 'couverture'],
filters: {
isNewRelease: { $eq: true }
},
pagination: { limit: 1 }
}, {
encodeValuesOnly: true
})
const {data} = await request(`/paroles?${query}`, {
next: {revalidate: 0},
headers: {Authorization: `Bearer ${readToken}`}
})
return data?.[0] ?? null
}
export async function jwennAnTeks(teksId, token) { export async function jwennAnTeks(teksId, token) {
const headers = { const headers = {
'content-type': 'application/json', 'content-type': 'application/json',