mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-26 15:58:50 +00:00
Made items list in alphabetical order
This commit is contained in:
parent
9fdb7e4b7d
commit
c41857ab3e
1 changed files with 4 additions and 4 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue