uses limit from the UI and defaults to 1k if not set
This commit is contained in:
@@ -6,10 +6,10 @@ const verifyToken = require("../../middlewares/authMiddleware");
|
||||
router.get("/", verifyToken, (req, res) => {
|
||||
const caseidPattern = req.query.caseidPattern + "%";
|
||||
const batchno = parseInt(req.query.batchno, 10) || 1;
|
||||
const limit = parseInt(req.query.limit, 10) || 1000;
|
||||
const offset = (batchno - 1) * limit;
|
||||
const sql =
|
||||
"SELECT id, uuid, caseid, modified_time FROM popcen WHERE caseid LIKE ? LIMIT ? OFFSET ?";
|
||||
const limit = 1000;
|
||||
const offset = (batchno - 1) * limit;
|
||||
|
||||
dataDb.query(sql, [caseidPattern, limit, offset], (err, results) => {
|
||||
if (err) {
|
||||
|
||||
Reference in New Issue
Block a user