Remove debug statements from story.js and clean up one linting error. Rename href in navbar from news to stories to unify API names.

This commit is contained in:
terakilobyte
2015-06-09 16:57:23 -04:00
parent 25e500a457
commit 5ec532f3d9
2 changed files with 5 additions and 14 deletions

View File

@ -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,

View File

@ -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