Added ability to limit dashboard results
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
@ -4,9 +4,16 @@ const License = db.licenses;
|
||||
|
||||
// GET - /
|
||||
exports.getIndex = async function(req, res) {
|
||||
// check if there's a limit set
|
||||
if (isset(req.body['limit'])) {
|
||||
const limit = req.body.limit;
|
||||
} else {
|
||||
const limit = 10;
|
||||
}
|
||||
|
||||
// fetch inventory items from database
|
||||
const items = await Item.findAll({
|
||||
limit: 10,
|
||||
limit: limit,
|
||||
order: [
|
||||
['updatedAt', 'DESC'],
|
||||
],
|
||||
@ -14,7 +21,7 @@ exports.getIndex = async function(req, res) {
|
||||
|
||||
// fetch licenses from database
|
||||
const licenses = await License.findAll({
|
||||
limit: 10,
|
||||
limit: limit,
|
||||
order: [
|
||||
['updatedAt', 'DESC'],
|
||||
],
|
||||
|
Reference in New Issue
Block a user