Skip to content

Commit a5014db

Browse files
VibhorCodecianGuptaVibhorCodecianGupta
authored andcommitted
end
1 parent bbb9893 commit a5014db

File tree

1 file changed

+26
-18
lines changed

1 file changed

+26
-18
lines changed

routes/api.js

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,27 +45,35 @@ route.get('/claims/:id/update', auth.adminOnly, (req, res) => {
4545
});
4646

4747
route.post('/claims/add', auth.ensureLoggedInGithub, (req, res) => {
48-
49-
if(process.env.BOSS_DEV === 'localhost'){
50-
req.user = {
51-
usergithub:{
52-
username:'Dhroov7'
48+
49+
const end = new Date(2018,7,16,0,0,0,0)
50+
const bossEnd = Date.parse(end)
51+
52+
if (bossEnd < Date.now()) {
53+
res.send("BOSS is now over!")
54+
}
55+
56+
if(process.env.BOSS_DEV === 'localhost'){
57+
req.user = {
58+
usergithub:{
59+
username:'Dhroov7'
60+
}
5361
}
5462
}
55-
}
5663

57-
du.createClaim(
58-
req.user.usergithub.username,
59-
req.body.issue_url,
60-
req.body.pull_url,
61-
req.body.bounty,
62-
config.CLAIM_STATUS.CLAIMED
63-
).then(claim => {
64-
res.send(claim)
65-
}).catch(err => {
66-
console.log(err);
67-
res.send("Sorry. Could not add the claim right now.");
68-
});
64+
du.createClaim(
65+
req.user.usergithub.username,
66+
req.body.issue_url,
67+
req.body.pull_url,
68+
req.body.bounty,
69+
config.CLAIM_STATUS.CLAIMED
70+
).then(claim => {
71+
res.send(claim)
72+
}).catch(err => {
73+
console.log(err);
74+
res.send("Sorry. Could not add the claim right now.");
75+
});
76+
6977
});
7078

7179

0 commit comments

Comments
 (0)