Adapt jwennDenyeTeks query and use qs stringify
This commit is contained in:
+10
-3
@@ -1,4 +1,5 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
import qs from 'qs'
|
||||||
|
|
||||||
const OKI_API = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:1337'
|
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
|
const AWTIS_POU_CHAK_PAJ = process.env.NEXT_PUBLIC_AWTIS_POU_CHAK_PAJ || 6
|
||||||
@@ -54,10 +55,16 @@ export async function jwennAwtisSlug() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function jwennDenyeTeks() {
|
export async function jwennDenyeTeks() {
|
||||||
const query = '_sort=published_at:DESC&_limit=6&_where[published_at_null]=false'
|
const query = qs.stringify({
|
||||||
|
populate: ['artistes', 'couverture'],
|
||||||
|
sort: ['publishedAt:desc'],
|
||||||
|
pagination: {
|
||||||
|
limit: 6
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const response = await axios.get(`${OKI_API}/teks?${query}`)
|
const {data} = await readAxiosInstance.get(`${OKI_API}/paroles?${query}`)
|
||||||
return response.data
|
return data.data
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function jwennAnTeks(teksId) {
|
export async function jwennAnTeks(teksId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user