3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-30 16:09:27 +01:00

lower case key

This commit is contained in:
Luke Slater 2011-09-15 12:34:01 +01:00
parent d3659eea6e
commit 9d0077b184

View File

@ -15,8 +15,9 @@ var webInterface = function(dbot) {
}); });
app.get('/quotes/:key', function(req, res) { app.get('/quotes/:key', function(req, res) {
if(dbot.db.quoteArrs.hasOwnProperty(req.params.key)) { var key = req.params.key.toLowerCase();
res.render('quotes', { 'quotes': dbot.db.quoteArrs[req.params.key] }); if(dbot.db.quoteArrs.hasOwnProperty(key)) {
res.render('quotes', { 'quotes': dbot.db.quoteArrs[key] });
} else { } else {
res.render('error', { 'message': 'No quotes under that key.' }); res.render('error', { 'message': 'No quotes under that key.' });
} }