From c41857ab3e6b08fcaee8ec7d9588f85a459f3869 Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Sun, 18 Aug 2024 09:59:58 -0500 Subject: [PATCH] Made items list in alphabetical order --- client/AdminMgmt/ProductMgmt/prodMgmtTbl.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/AdminMgmt/ProductMgmt/prodMgmtTbl.js b/client/AdminMgmt/ProductMgmt/prodMgmtTbl.js index 8f4b4cc..5f9d817 100644 --- a/client/AdminMgmt/ProductMgmt/prodMgmtTbl.js +++ b/client/AdminMgmt/ProductMgmt/prodMgmtTbl.js @@ -22,19 +22,19 @@ Template.prodMgmtTbl.helpers({ if (typeof searchVal == 'undefined' || searchVal.length == 0) { return Products.find({}); } else { - return Products.find({ prodName: { $regex: searchVal + '.*', $options: 'i' } }); + return Products.find({ prodName: { $regex: searchVal + '.*', $options: 'i' } }, { sort: { prodName: 1 }}); } } else if (searchStore == true) { let searchVal = Session.get("searchStoreVal"); if (typeof searchVal == 'undefined' || searchVal.length == 0) { return Products.find({}); } else { - return Products.find({ prodStore: { $regex: searchVal + '.*', $options: 'i' } }); + return Products.find({ prodStore: { $regex: searchVal + '.*', $options: 'i' } }, { sort: { prodName: 1 }}); } } else if (noStoreSet == true) { - return Products.find({ prodStore: '' }); + return Products.find({ prodStore: '' }, { sort: { prodName: 1 }}); } else { - return Products.find({}); + return Products.find({}, { sort: { prodName: 1 }}); } }, searchProd: function() {