Create oki-api
This commit is contained in:
@@ -0,0 +1,26 @@
|
|||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
const OKI_API = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:1337'
|
||||||
|
|
||||||
|
export async function getAwtis() {
|
||||||
|
const response = await axios.get(`${OKI_API}/awtis`)
|
||||||
|
return response.data
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function jwennAwtisKantite() {
|
||||||
|
const response = await axios.get(`${OKI_API}/awtis/count`)
|
||||||
|
return response.data
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function jwennAwtisPajinasyon(paj) {
|
||||||
|
const start = 8 * (paj - 1)
|
||||||
|
const query = `_sort=alias:ASC&_start=${start}&_limit=8`
|
||||||
|
|
||||||
|
const response = await axios.get(`${OKI_API}/awtis?${query}`)
|
||||||
|
return response.data
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function jwennTeks() {
|
||||||
|
const response = await axios.get(`${OKI_API}/mizik`)
|
||||||
|
return response.data
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user