nfp_sites/nfp_moe/api/page_routes.mjs

19 lines
600 B
JavaScript
Raw Normal View History

2022-08-18 11:43:20 +00:00
import { parseArticles, parseArticle } from '../base/article/util.mjs'
import Parent from '../base/page/routes.mjs'
import { parsePage } from '../base/page/util.mjs'
2022-08-12 23:33:50 +00:00
import { combineFilesWithArticles } from './file/util.mjs'
export default class PageRoutes extends Parent {
getPage_resOut(res) {
let out = {
page: parsePage(res.results[0][0]),
articles: parseArticles(res.results[1]),
total_articles: res.results[2][0].total_articles,
featured: parseArticle(res.results[4][0]),
}
combineFilesWithArticles(out.articles, res.results[3])
return out
}
}