Fixed errors caught by linter
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Gregory Ballantine
2024-05-24 12:09:09 -04:00
parent 6d8965ada1
commit 93afda6d10
3 changed files with 13 additions and 13 deletions

View File

@ -1,19 +1,19 @@
const db = require('../models');
const Item = db.items;
const License = db.licenses;
const { Op } = require('sequelize');
const {Op} = require('sequelize');
// GET - /search
exports.getSearch = async function(req, res) {
// decode URL search query
let query = req.query.query;
const query = req.query.query;
// fetch inventory items from database based on search query
const item_results = await Item.findAll({
const itemResults = await Item.findAll({
where: {
name: {
[Op.like]: '%' + query + '%',
}
},
},
limit: 10,
order: [
@ -22,11 +22,11 @@ exports.getSearch = async function(req, res) {
});
// fetch licenses from database based on search query
const license_results = await License.findAll({
const licenseResults = await License.findAll({
where: {
name: {
[Op.like]: '%' + query + '%',
}
},
},
limit: 10,
order: [
@ -36,7 +36,7 @@ exports.getSearch = async function(req, res) {
res.render('search.twig', {
query: query,
item_results: item_results,
license_results: license_results,
itemResults: itemResults,
licenseResults: licenseResults,
});
};