Add banning to camper news

This commit is contained in:
Berkeley Martinez
2016-01-12 22:07:19 -08:00
parent f392fbd916
commit 52fd15284a
3 changed files with 17 additions and 5 deletions

View File

@@ -214,8 +214,12 @@ $(document).ready(function() {
.fail(function() {
$('#story-submit').bind('click', storySubmitButtonHandler);
})
.done(function(data) {
window.location = '/stories/' + data.storyLink;
.done(function({ storyLink, isBanned }) {
if (isBanned) {
window.location = '/news';
return null;
}
window.location = '/stories/' + storyLink;
});
};