Defining artists per page with env variable
This commit is contained in:
+3
-1
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user