Defining artists per page with env variable
This commit is contained in:
+3
-2
@@ -1,6 +1,7 @@
|
||||
import axios from 'axios'
|
||||
|
||||
const OKI_API = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:1337'
|
||||
const AWTIS_POU_CHAK_PAJ = process.env.NEXT_PUBLIC_AWTIS_POU_CHAK_PAJ || 6
|
||||
|
||||
export async function getAwtis() {
|
||||
const response = await axios.get(`${OKI_API}/awtis`)
|
||||
@@ -13,8 +14,8 @@ export async function jwennAwtisKantite() {
|
||||
}
|
||||
|
||||
export async function jwennAwtisPajinasyon(paj) {
|
||||
const start = 8 * (paj - 1)
|
||||
const query = `_sort=alias:ASC&_start=${start}&_limit=8`
|
||||
const start = AWTIS_POU_CHAK_PAJ * (paj - 1)
|
||||
const query = `_sort=alias:ASC&_start=${start}&_limit=${AWTIS_POU_CHAK_PAJ}`
|
||||
|
||||
const response = await axios.get(`${OKI_API}/awtis?${query}`)
|
||||
return response.data
|
||||
|
||||
Reference in New Issue
Block a user