Bill board feature up and running
This commit is contained in:
@@ -85,21 +85,44 @@ module.exports = function(app) {
|
||||
}
|
||||
|
||||
function billBoard(req, res) {
|
||||
if(req.user && typeof req.user.currentChallenge.challengeId !== "undefined"){
|
||||
BillBoard.findOne({}, function(err, data){
|
||||
if(err){
|
||||
res.send({err: {type: "Error", message: "Database Error"}, data: null});
|
||||
if (
|
||||
req.user
|
||||
&& typeof req.user.currentChallenge.challengeId !== 'undefined'
|
||||
) {
|
||||
BillBoard.findOne({}, function(err, data) {
|
||||
if (err) {
|
||||
res.send({
|
||||
err: {
|
||||
type: 'Error',
|
||||
message: 'Database Error'
|
||||
},
|
||||
data: null
|
||||
});
|
||||
} else {
|
||||
if (data.active) {
|
||||
res.send({err: null, data: data.message});
|
||||
res.send({
|
||||
err: null,
|
||||
data: data.message
|
||||
});
|
||||
} else {
|
||||
res.send({err: {type: "warning", message: "Bill Board is not active"}, data: null});
|
||||
res.send({
|
||||
err: {
|
||||
type: 'warning',
|
||||
message: 'Bill Board is not active'
|
||||
},
|
||||
data: null
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
res.send({err: {type: "warning", message: "User Not Signed In"}, data: null});
|
||||
} else {
|
||||
res.send({
|
||||
err: {
|
||||
type: 'warning',
|
||||
message: 'User Not Signed In'
|
||||
},
|
||||
data: null
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,7 @@
|
||||
div!= success.msg
|
||||
.row.flashMessage
|
||||
.col-xs-12
|
||||
.alert.alert-success.fade.in
|
||||
#billBoard.alert.alert-success.fade.in(style="display: none;")
|
||||
button.close(type='button', data-dismiss='alert')
|
||||
span.ion-close-circled#dismissBill
|
||||
#billContent
|
Reference in New Issue
Block a user