Fix minor bugs
This commit is contained in:
@ -76,7 +76,7 @@ exports.returnIndividualStory = function(req, res, next) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
story = story.pop();
|
story = story.pop();
|
||||||
var dashedNameFull = story.headline.toLowerCase().replace(/\s/g, '-');
|
var dashedNameFull = story.storyLink.toLowerCase().replace(/\s/g, '-');
|
||||||
if (dashedNameFull !== dashedName) {
|
if (dashedNameFull !== dashedName) {
|
||||||
return res.redirect('../stories/' + dashedNameFull);
|
return res.redirect('../stories/' + dashedNameFull);
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,3 @@
|
|||||||
[
|
[
|
||||||
{
|
|
||||||
"associatedPost": "54f584db16cd6570aa176eda",
|
|
||||||
"body": "cats like to sit around and be lazy as hell",
|
|
||||||
"rank": "1",
|
|
||||||
"upvotes": [],
|
|
||||||
"author": {
|
|
||||||
"username" : "terakilonoob",
|
|
||||||
"picture": "https://thedrinkingtraveler.files.wordpress.com/2015/02/24127-funny-grumpy-cat-memesvery-bad-morning-meme-0rlh4r5c-wallpaper-1024x1024.jpg",
|
|
||||||
"id" : "ade671aa0756dc61bd485f45"
|
|
||||||
},
|
|
||||||
"comments": [],
|
|
||||||
"topLevel": true
|
|
||||||
}
|
|
||||||
]
|
]
|
@ -1,84 +1,3 @@
|
|||||||
[
|
[
|
||||||
{
|
|
||||||
"headline": "Cat sits on keyboard 0",
|
|
||||||
"storyLink": "cat sits on keyboard 0",
|
|
||||||
"link": "http://kotaku.com/5991046/why-cats-love-sitting-on-keyboards",
|
|
||||||
"description": "cats love keyboards you know",
|
|
||||||
"rank": 0,
|
|
||||||
"upVotes": [],
|
|
||||||
"timePosted": 1425429660000,
|
|
||||||
"author": {
|
|
||||||
"username": "testuser",
|
|
||||||
"userId": "a2ad135e2aa27c14fc73ee11",
|
|
||||||
"picture": "http://www.cutecatgifs.com/wp-content/uploads/2013/11/little_guy_sleeping_in_lap.gif"
|
|
||||||
},
|
|
||||||
"comments": [],
|
|
||||||
"image": "http://rossmounce.co.uk/wp-content/uploads/2014/11/grumpy-cat-no-1.jpg"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"headline": "Cat sits on keyboard 1",
|
|
||||||
"storyLink": "cat sits on keyboard 1",
|
|
||||||
"link": "http://kotaku.com/5991046/why-cats-love-sitting-on-keyboards",
|
|
||||||
"description": "cats love keyboards you know",
|
|
||||||
"rank": 1,
|
|
||||||
"upVotes": [],
|
|
||||||
"timePosted": 1425429660000,
|
|
||||||
"author": {
|
|
||||||
"username": "testuser",
|
|
||||||
"userId": "a2ad135e2aa27c14fc73ee22",
|
|
||||||
"picture": "http://www.cutecatgifs.com/wp-content/uploads/2013/11/little_guy_sleeping_in_lap.gif"
|
|
||||||
},
|
|
||||||
"comments": [],
|
|
||||||
"image": "http://rossmounce.co.uk/wp-content/uploads/2014/11/grumpy-cat-no-1.jpg"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"headline": "Cat sits on keyboard 3",
|
|
||||||
"storyLink": "cat sits on keyboard 3",
|
|
||||||
"link": "http://kotaku.com/5991046/why-cats-love-sitting-on-keyboards",
|
|
||||||
"description": "cats love keyboards you know",
|
|
||||||
"rank": 3,
|
|
||||||
"upVotes": [],
|
|
||||||
"timePosted": 1425429660000,
|
|
||||||
"author": {
|
|
||||||
"username": "testuser",
|
|
||||||
"userId": "a2ad135e2aa27c14fc73ee33",
|
|
||||||
"picture": "http://www.cutecatgifs.com/wp-content/uploads/2013/11/little_guy_sleeping_in_lap.gif"
|
|
||||||
},
|
|
||||||
"comments": [],
|
|
||||||
"image": "http://rossmounce.co.uk/wp-content/uploads/2014/11/grumpy-cat-no-1.jpg"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"headline": "Cat sits on keyboard 20",
|
|
||||||
"storyLink": "cat sits on keyboard 20",
|
|
||||||
"link": "http://kotaku.com/5991046/why-cats-love-sitting-on-keyboards",
|
|
||||||
"description": "ipsizzle dolizzle sit amet, ghetto adipiscing elit. Nullam fo shizzle velizzle, aliquet volutpizzle, suscipizzle shiz, gravida vizzle, arcu. Pellentesque izzle tortor. Sizzle doggy. Boom shackalack izzle dolizzle dapibizzle ass tempizzle tellivizzle. Ma nizzle we gonna chung shiz izzle tellivizzle. Vestibulum dizzle tortor. Pellentesque pimpin' rhoncus you son of a bizzle. In dizzle habitasse platea dictumst. Donec dapibizzle. Curabitizzle pot yippiyo, pretizzle da bomb, mattis izzle, da bomb vitae, nunc. Ass suscipizzle. Cool sempizzle bow wow wow sed purus.",
|
|
||||||
"rank": 20,
|
|
||||||
"upVotes": [],
|
|
||||||
"timePosted": 1425429660000,
|
|
||||||
"author": {
|
|
||||||
"username": "testuser",
|
|
||||||
"userId": "a2ad135e2aa27c14fc73ee44",
|
|
||||||
"picture": "http://www.cutecatgifs.com/wp-content/uploads/2013/11/little_guy_sleeping_in_lap.gif"
|
|
||||||
},
|
|
||||||
"comments": [
|
|
||||||
"54f61b0e43f0c2b90f162ec4"
|
|
||||||
],
|
|
||||||
"image": "http://rossmounce.co.uk/wp-content/uploads/2014/11/grumpy-cat-no-1.jpg"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"headline": "Cat sits on keyboard 2",
|
|
||||||
"storyLink": "cat sits on keyboard 2",
|
|
||||||
"link": "http://kotaku.com/5991046/why-cats-love-sitting-on-keyboards",
|
|
||||||
"description": "cats love keyboards you know",
|
|
||||||
"rank": 2,
|
|
||||||
"upVotes": [],
|
|
||||||
"timePosted": 1425429660000,
|
|
||||||
"author": {
|
|
||||||
"username": "testuser",
|
|
||||||
"userId": "a2ad135e2aa27c14fc73ee55",
|
|
||||||
"picture": "http://www.cutecatgifs.com/wp-content/uploads/2013/11/little_guy_sleeping_in_lap.gif"
|
|
||||||
},
|
|
||||||
"comments": [],
|
|
||||||
"image": "http://rossmounce.co.uk/wp-content/uploads/2014/11/grumpy-cat-no-1.jpg"
|
|
||||||
}
|
|
||||||
]
|
]
|
@ -4,7 +4,7 @@ h3
|
|||||||
script(src="https://cdn.jsdelivr.net/ramda/0.10.0/ramda.min.js")
|
script(src="https://cdn.jsdelivr.net/ramda/0.10.0/ramda.min.js")
|
||||||
script.
|
script.
|
||||||
var getLinkedName = function getLinkedName(name) {
|
var getLinkedName = function getLinkedName(name) {
|
||||||
return name.toLowerCase().replace(/\s/g, '-');
|
return name.trim().toLowerCase().replace(/\s/g, '-');
|
||||||
}
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/stories/hotStories',
|
url: '/stories/hotStories',
|
||||||
|
Reference in New Issue
Block a user