nfp_sites/nfp_moe/api/page_routes.mjs
Jonatan Nilsson 4b36820f09
All checks were successful
continuous-integration/appveyor/branch AppVeyor build succeeded
nfp_moe: Fix invalid imports in api
2022-08-18 11:43:20 +00:00

19 lines
No EOL
600 B
JavaScript

import { parseArticles, parseArticle } from '../base/article/util.mjs'
import Parent from '../base/page/routes.mjs'
import { parsePage } from '../base/page/util.mjs'
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
}
}