Skip to content

Boss end #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 25 additions & 18 deletions routes/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,34 @@ 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 bossEnd = Date.parse('16 Aug 2018 00:00:00 GMT+05:30')

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.");
});

});


Expand Down
7 changes: 7 additions & 0 deletions routes/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down