Adding User Pagination Using Ajax Call
// controllers/dashboard/author.js class Author{ constructor(){ this.deepcopy = require('deepcopy'); this.vdict = require('../../config'); this.utility = require('../../utility'); this.usersdb = require('../../models/usersdb'); this.emailCheck = require('email-check'); this.bcrypt = require('bcryptjs'); } async getAuthor(req, res){ const self = this; const data = this.deepcopy(this.vdict); data.site_title = 'ទំព័រអ្នកនិពន្ធ'; data.date = this.utility.setDate(); data.authors = await this.usersdb.selectUser(this.vdict.dashboardLimit); data.thumbs = self.utility.getThumbUrl(data.authors, 'author'); data.count = await self.usersdb.countUser(); if(req.params.authorId){ data.edited = await self.usersdb.selectUser(self.vdict.dashboardLimit, req.params.authorId); res.render('dashboard/author', data); }else res.render('...