Remove some debug/console.log statements.

Fix allFieldGuideIds method in resources.js to return an array of _ids, not an array of objects.
Field guide controller now correctly completes field guides. Closes #367.
This commit is contained in:
terakilobyte
2015-04-25 12:28:14 -04:00
parent a6f6d7e1cf
commit a9feb269f6
7 changed files with 11 additions and 18 deletions

View File

@@ -118,7 +118,7 @@ exports.preSubmit = function(req, res) {
exports.returnIndividualStory = function(req, res, next) {
var dashedName = req.params.storyName;
var storyName = dashedName.replace(/\-/g, ' ');
var storyName = dashedName.replace(/\-/g, ' ').trim();
Story.find({'storyLink': storyName}, function(err, story) {
if (err) {
@@ -321,9 +321,10 @@ exports.storySubmission = function(req, res, next) {
.replace(/\'/g, '')
.replace(/\"/g, '')
.replace(/,/g, '')
.replace(/[^a-z0-9]/gi, ' ')
.replace(/\s+/g, ' ')
.toLowerCase();
.replace(/[^a-z0-9\s]/gi, '')
.toLowerCase()
.trim();
var link = data.link;
if (link.search(/^https?:\/\//g) === -1) {
link = 'http://' + link;
@@ -334,7 +335,7 @@ exports.storySubmission = function(req, res, next) {
}
// if duplicate storyLink add unique number
storyLink = (storyCount == 0) ? storyLink : storyLink + ' ' + storyCount;
storyLink = (storyCount === 0) ? storyLink : storyLink + ' ' + storyCount;
var link = data.link;
if (link.search(/^https?:\/\//g) === -1) {