Added ability to limit dashboard results
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Gregory Ballantine
2024-05-24 12:35:01 -04:00
parent 93afda6d10
commit d95be2e185
3 changed files with 27 additions and 2 deletions

View File

@ -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'],
],