From 5ec532f3d98489d56303db6a009d118ad3ba2ce7 Mon Sep 17 00:00:00 2001 From: terakilobyte Date: Tue, 9 Jun 2015 16:57:23 -0400 Subject: [PATCH] Remove debug statements from story.js and clean up one linting error. Rename href in navbar from news to stories to unify API names. --- server/boot/story.js | 17 ++++------------- server/views/partials/navbar.jade | 2 +- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/server/boot/story.js b/server/boot/story.js index 1910280306..25644b4c89 100755 --- a/server/boot/story.js +++ b/server/boot/story.js @@ -2,7 +2,7 @@ var nodemailer = require('nodemailer'), sanitizeHtml = require('sanitize-html'), moment = require('moment'), mongodb = require('mongodb'), - debug = require('debug')('freecc:cntr:story'), + // debug = require('debug')('freecc:cntr:story'), utils = require('../utils'), MongoClient = mongodb.MongoClient, secrets = require('../../config/secrets'); @@ -42,20 +42,12 @@ module.exports = function(app) { return hotness; } - function hotJSON(req, res, next) { - //var story = Story.find({}).sort({'timePosted': -1}).limit(1000); - //story.exec(function(err, stories) { - // if (err) { - // return next(err); - // } - //Story.find([{$match: {}}, - // {$sort: {'timePosted': -1}}, - // {$limit: 1000}], function(err, stories) { + function hotJSON(req, res, next) { // no-unused-vars + Story.find({order: 'timePosted DESC', limit: 1000}, function(err, stories) { if (err) { return next(err); } - debug(stories); var foundationDate = 1413298800000; var sliceVal = stories.length >= 100 ? 100 : stories.length; @@ -132,7 +124,6 @@ module.exports = function(app) { function returnIndividualStory(req, res, next) { - debug('hit return individual route'); var dashedName = req.params.storyName; var storyName = dashedName.replace(/\-/g, ' ').trim(); @@ -198,7 +189,7 @@ module.exports = function(app) { } database.collection('stories').find({ '$text': { - '$search': req.body.data ? req.body.data.searchValue : "" + '$search': req.body.data ? req.body.data.searchValue : '' } }, { headline: 1, diff --git a/server/views/partials/navbar.jade b/server/views/partials/navbar.jade index 6281fa918b..317ce661d1 100644 --- a/server/views/partials/navbar.jade +++ b/server/views/partials/navbar.jade @@ -20,7 +20,7 @@ nav.navbar.navbar-default.navbar-fixed-top.nav-height li a(href='/challenges/waypoint-join-our-chat-room') Chat li - a(href='/news') News + a(href='/stories') News li a(href='/field-guide') Guide li