Defining artists per page with env variable

This commit is contained in:
2020-12-12 21:50:16 +01:00
parent fff4abbdff
commit 6ab2ef7870
3 changed files with 8 additions and 3 deletions
+3 -1
View File
@@ -7,6 +7,8 @@ import Navigasyon from '../components/navigasyon'
import AwtisKat from '../components/awtis/awtis-kat'
import Pajinasyon from '../components/awtis/pajinasyon'
const AWTIS_POU_CHAK_PAJ = process.env.NEXT_PUBLIC_AWTIS_POU_CHAK_PAJ || 6
export default function Awtis({pajTotal, awtisPouChakPaj, paj}) {
return (
<>
@@ -34,7 +36,7 @@ export async function getServerSideProps({query}) {
const awtisPouChakPaj = await jwennAwtisPajinasyon(pajParsed)
const awtisCountRequest = await jwennAwtisKantite()
const awtisCount = Number.parseInt(awtisCountRequest, 10)
const pajTotal = Math.ceil(awtisCount / 8)
const pajTotal = Math.ceil(awtisCount / AWTIS_POU_CHAK_PAJ)
if (pajParsed > pajTotal) {
throw new Error('Pa twouvé paj-la')