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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user