Finished building blog overview page.

This commit is contained in:
2018-11-25 18:38:42 +11:00
parent 8ab9f09287
commit 83369773cd
15 changed files with 312 additions and 40 deletions

View File

@ -46,6 +46,12 @@ module.exports = class Articles extends DatabaseInterface {
);
}
async getArticlesPageCount(perPage) {
if(!perPage) perPage = 10;
let count = await this.getArticlesCount(perPage);
return Math.ceil(count/perPage);
}
async getArticlesByPage(page, perPage) {
if(!page) page = 1;
if(!perPage) perPage = 10;