From a5014db5f3e05e4f042d446cd0ad45217776e957 Mon Sep 17 00:00:00 2001 From: VibhorCodecianGupta Date: Sat, 11 Aug 2018 22:17:12 +0530 Subject: [PATCH 1/2] end --- routes/api.js | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/routes/api.js b/routes/api.js index dc62ea9..324426d 100644 --- a/routes/api.js +++ b/routes/api.js @@ -45,27 +45,35 @@ route.get('/claims/:id/update', auth.adminOnly, (req, res) => { }); route.post('/claims/add', auth.ensureLoggedInGithub, (req, res) => { - - if(process.env.BOSS_DEV === 'localhost'){ - req.user = { - usergithub:{ - username:'Dhroov7' + + const end = new Date(2018,7,16,0,0,0,0) + const bossEnd = Date.parse(end) + + if (bossEnd < Date.now()) { + res.send("BOSS is now over!") + } + + if(process.env.BOSS_DEV === 'localhost'){ + req.user = { + usergithub:{ + username:'Dhroov7' + } } } - } - du.createClaim( - req.user.usergithub.username, - req.body.issue_url, - req.body.pull_url, - req.body.bounty, - config.CLAIM_STATUS.CLAIMED - ).then(claim => { - res.send(claim) - }).catch(err => { - console.log(err); - res.send("Sorry. Could not add the claim right now."); - }); + du.createClaim( + req.user.usergithub.username, + req.body.issue_url, + req.body.pull_url, + req.body.bounty, + config.CLAIM_STATUS.CLAIMED + ).then(claim => { + res.send(claim) + }).catch(err => { + console.log(err); + res.send("Sorry. Could not add the claim right now."); + }); + }); From c25c19d72cf1f81954efad826807b8f10c9f4d8b Mon Sep 17 00:00:00 2001 From: VibhorCodecianGupta Date: Sun, 12 Aug 2018 07:27:47 +0530 Subject: [PATCH 2/2] IST --- routes/api.js | 3 +-- routes/root.js | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/routes/api.js b/routes/api.js index 324426d..2d85853 100644 --- a/routes/api.js +++ b/routes/api.js @@ -46,8 +46,7 @@ route.get('/claims/:id/update', auth.adminOnly, (req, res) => { route.post('/claims/add', auth.ensureLoggedInGithub, (req, res) => { - const end = new Date(2018,7,16,0,0,0,0) - const bossEnd = Date.parse(end) + const bossEnd = Date.parse('16 Aug 2018 00:00:00 GMT+05:30') if (bossEnd < Date.now()) { res.send("BOSS is now over!") diff --git a/routes/root.js b/routes/root.js index 214efed..f291828 100644 --- a/routes/root.js +++ b/routes/root.js @@ -183,6 +183,13 @@ route.get('/claims/:id', auth.adminOnly, (req, res) => { }); route.post('/claims/add', auth.ensureLoggedInGithub, (req, res) => { + + const bossEnd = Date.parse('16 Aug 2018 00:00:00 GMT+05:30') + + if (bossEnd < Date.now()) { + res.send("BOSS is now over!") + } + du.createClaim( req.user.usergithub.username, // github username already valid req.body.issue_url,