feed generator updated to tags
This commit is contained in:
1 parent
79a127636c
commit
0b230a26b4
1 file changed
+7
-4
+7
-4
@@ -6,9 +6,12 @@ const api = axios.create({
|
||||
baseURL: 'https://api.tmshv.com/hudozka',
|
||||
})
|
||||
|
||||
async function getArticles(pageSize) {
|
||||
const page = 1
|
||||
const res = await api.get(`/api/articles?page=${page}&pageSize=${pageSize}`)
|
||||
async function getArticles(limit) {
|
||||
const query = ['post', 'event', 'album']
|
||||
.map(t => `tag=${t}`)
|
||||
.join('&')
|
||||
const url = `/api/pages/tags?${query}&sortBy=-date&skip=0&pageSize=${limit}`
|
||||
const res = await api.get(url)
|
||||
|
||||
return res.data.items
|
||||
}
|
||||
@@ -32,7 +35,7 @@ async function getArticles(pageSize) {
|
||||
date: new Date(article.date),
|
||||
id: article.id,
|
||||
link: article.url,
|
||||
content: article.post,
|
||||
content: article.data,
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user