Created
May 7, 2015 19:19
-
-
Save geoffreysmith/43ff607f870249760702 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var superGet = self.get; | |
self.get = function (req, userCriteria, optionsArg, callback) { | |
var options = {}; | |
var filterCriteria = {}; | |
// "Why copy the object like this?" If we don't, we're modifying the | |
// object that was passed to us, which could lead to side effects | |
_.merge(options, optionsArg || {}); | |
_.merge(filterCriteria, userCriteria || {}); | |
// need a sort helper key on these fields to normalize the first and last names | |
// and handle upper/lower case letters. Adding this helper key normalizes the data. | |
// options.sort = { lastname: 1, firstname: 1 }; | |
options.sort = {title: 1}; | |
return superGet.call(self, req, filterCriteria, options, callback); | |
}; | |
apos.addLocal('aposMainNav', function () { | |
var test = app.request; | |
self.get(test, {}, {}, function (data) { | |
return self.render('mainnav', data); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment