Update story api to use stories instead of news

This commit is contained in:
terakilobyte
2015-06-05 09:07:46 -04:00
parent 875d09c29b
commit 8b7bfb23ab
3 changed files with 8 additions and 8 deletions

View File

@ -324,7 +324,7 @@ $(document).ready(function() {
$('#story-submit').bind('click', storySubmitButtonHandler); $('#story-submit').bind('click', storySubmitButtonHandler);
}) })
.done(function (data, textStatus, xhr) { .done(function (data, textStatus, xhr) {
window.location = '/news/' + JSON.parse(data).storyLink; window.location = '/stories/' + JSON.parse(data).storyLink;
}); });
}; };

View File

@ -22,9 +22,9 @@ module.exports = function(app) {
router.get('/stories/submit/new-story', preSubmit); router.get('/stories/submit/new-story', preSubmit);
router.post('/stories/preliminary', newStory); router.post('/stories/preliminary', newStory);
router.post('/stories/', storySubmission); router.post('/stories/', storySubmission);
router.get('/news/', hot); router.get('/stories/', hot);
router.post('/stories/search', getStories); router.post('/stories/search', getStories);
router.get('/news/:storyName', returnIndividualStory); router.get('/stories/:storyName', returnIndividualStory);
router.post('/stories/upvote/', upvote); router.post('/stories/upvote/', upvote);
app.use(router); app.use(router);
@ -152,7 +152,7 @@ module.exports = function(app) {
'Please double check the name.' 'Please double check the name.'
}); });
return res.redirect('/news/'); return res.redirect('/stories/');
} }
story = story.pop(); story = story.pop();
@ -160,7 +160,7 @@ module.exports = function(app) {
.replace(/\s+/g, ' ') .replace(/\s+/g, ' ')
.replace(/\s/g, '-'); .replace(/\s/g, '-');
if (dashedNameFull !== dashedName) { if (dashedNameFull !== dashedName) {
return res.redirect('../news/' + dashedNameFull); return res.redirect('../stories/' + dashedNameFull);
} }
var userVoted = false; var userVoted = false;
@ -324,7 +324,7 @@ module.exports = function(app) {
}); });
return res.json({ return res.json({
alreadyPosted: true, alreadyPosted: true,
storyURL: '/news/' + story.pop().storyLink storyURL: '/stories/' + story.pop().storyLink
}); });
} }
utils.getURLTitle(url, processResponse); utils.getURLTitle(url, processResponse);
@ -600,7 +600,7 @@ module.exports = function(app) {
data.author.username + ' replied to you on Camper News.', data.author.username + ' replied to you on Camper News.',
'You can keep this conversation going.', 'You can keep this conversation going.',
'Just head back to the discussion here: ', 'Just head back to the discussion here: ',
'http://freecodecamp.com/news/' + data.originalStoryLink, 'http://freecodecamp.com/stories/' + data.originalStoryLink,
'- the Free Code Camp Volunteer Team' '- the Free Code Camp Volunteer Team'
].join('\n') ].join('\n')
}; };

View File

@ -25,7 +25,7 @@ nav.navbar.navbar-default.navbar-fixed-top.nav-height
li li
a(href='/challenges/waypoint-join-our-chat-room') Chat a(href='/challenges/waypoint-join-our-chat-room') Chat
li li
a(href='/news') News a(href='/stories') News
li li
a(href='/field-guide') Guide a(href='/field-guide') Guide
li.hidden-xs.hidden-sm li.hidden-xs.hidden-sm