From 8b7bfb23abb52de6b18621dd44c8c375e26ae741 Mon Sep 17 00:00:00 2001 From: terakilobyte Date: Fri, 5 Jun 2015 09:07:46 -0400 Subject: [PATCH] Update story api to use stories instead of news --- public/js/main_0.0.2.js | 2 +- server/boot/story.js | 12 ++++++------ server/views/partials/navbar.jade | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/public/js/main_0.0.2.js b/public/js/main_0.0.2.js index 601baef073..209ccde97e 100644 --- a/public/js/main_0.0.2.js +++ b/public/js/main_0.0.2.js @@ -324,7 +324,7 @@ $(document).ready(function() { $('#story-submit').bind('click', storySubmitButtonHandler); }) .done(function (data, textStatus, xhr) { - window.location = '/news/' + JSON.parse(data).storyLink; + window.location = '/stories/' + JSON.parse(data).storyLink; }); }; diff --git a/server/boot/story.js b/server/boot/story.js index 3184a02141..3aac952cc6 100755 --- a/server/boot/story.js +++ b/server/boot/story.js @@ -22,9 +22,9 @@ module.exports = function(app) { router.get('/stories/submit/new-story', preSubmit); router.post('/stories/preliminary', newStory); router.post('/stories/', storySubmission); - router.get('/news/', hot); + router.get('/stories/', hot); router.post('/stories/search', getStories); - router.get('/news/:storyName', returnIndividualStory); + router.get('/stories/:storyName', returnIndividualStory); router.post('/stories/upvote/', upvote); app.use(router); @@ -152,7 +152,7 @@ module.exports = function(app) { 'Please double check the name.' }); - return res.redirect('/news/'); + return res.redirect('/stories/'); } story = story.pop(); @@ -160,7 +160,7 @@ module.exports = function(app) { .replace(/\s+/g, ' ') .replace(/\s/g, '-'); if (dashedNameFull !== dashedName) { - return res.redirect('../news/' + dashedNameFull); + return res.redirect('../stories/' + dashedNameFull); } var userVoted = false; @@ -324,7 +324,7 @@ module.exports = function(app) { }); return res.json({ alreadyPosted: true, - storyURL: '/news/' + story.pop().storyLink + storyURL: '/stories/' + story.pop().storyLink }); } utils.getURLTitle(url, processResponse); @@ -600,7 +600,7 @@ module.exports = function(app) { data.author.username + ' replied to you on Camper News.', 'You can keep this conversation going.', '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' ].join('\n') }; diff --git a/server/views/partials/navbar.jade b/server/views/partials/navbar.jade index 8c6e2ff37d..cdbefeb583 100644 --- a/server/views/partials/navbar.jade +++ b/server/views/partials/navbar.jade @@ -25,7 +25,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.hidden-xs.hidden-sm