chore: commit lint fixes for the api

This commit is contained in:
Bouncey
2019-02-06 14:19:58 +00:00
committed by mrugesh mohapatra
parent 010fa63e76
commit 07266b7e43
17 changed files with 159 additions and 154 deletions

View File

@ -21,9 +21,9 @@ export default function donateBoot(app, done) {
name:
'Monthly Donation to freeCodeCamp.org - ' +
`Thank you ($${current / 100})`
},
currency: 'usd',
id: `monthly-donation-${current}`
},
currency: 'usd',
id: `monthly-donation-${current}`
}
}), {}
);
@ -59,8 +59,8 @@ export default function donateBoot(app, done) {
throw err;
}
console.log(`${plan.id} created`);
return;
});
return;
});
}
function createStripeDonation(req, res) {
@ -104,34 +104,34 @@ export default function donateBoot(app, done) {
email,
card: id
});
})
.then(customer => {
donation.customerId = customer.id;
return stripe.subscriptions.create({
customer: customer.id,
items: [
{
plan: `monthly-donation-${amount}`
}
]
});
})
.then(subscription => {
donation.subscriptionId = subscription.id;
return res.send(subscription);
})
.then(() => {
donatingUser.createDonation(donation).toPromise()
.catch(err => {
throw new Error(err);
})
.then(customer => {
donation.customerId = customer.id;
return stripe.subscriptions.create({
customer: customer.id,
items: [
{
plan: `monthly-donation-${amount}`
}
]
});
})
.catch(err => {
if (err.type === 'StripeCardError') {
return res.status(402).send({ error: err.message });
}
return res.status(500).send({ error: 'Donation Failed' });
});
})
.then(subscription => {
donation.subscriptionId = subscription.id;
return res.send(subscription);
})
.then(() => {
donatingUser.createDonation(donation).toPromise()
.catch(err => {
throw new Error(err);
});
})
.catch(err => {
if (err.type === 'StripeCardError') {
return res.status(402).send({ error: err.message });
}
return res.status(500).send({ error: 'Donation Failed' });
});
}
const pubKey = keys.stripe.public;

View File

@ -88,7 +88,7 @@ module.exports = function(app) {
.then(() => {
req.flash(
'success',
"We've successfully updated your email preferences."
'We\'ve successfully updated your email preferences.'
);
return res.redirectWithFlash(
`${homeLocation}/unsubscribed/${unsubscribeId}`
@ -144,7 +144,7 @@ module.exports = function(app) {
.then(() => {
req.flash(
'success',
"We've successfully updated your email preferences. Thank you " +
'We\'ve successfully updated your email preferences. Thank you ' +
'for resubscribing.'
);
return res.redirectWithFlash(homeLocation);
@ -175,7 +175,7 @@ module.exports = function(app) {
}
pulls = pulls
? Object.keys(JSON.parse(pulls)).length
: "Can't connect to github";
: 'Can\'t connect to github';
return request(
[
@ -193,7 +193,7 @@ module.exports = function(app) {
issues =
pulls === parseInt(pulls, 10) && issues
? Object.keys(JSON.parse(issues)).length - pulls
: "Can't connect to GitHub";
: 'Can\'t connect to GitHub';
return res.send({
issues: issues,
pulls: pulls

View File

@ -229,7 +229,7 @@ function createPostReportUserProfile(app) {
to: 'team@freecodecamp.org',
cc: user.email,
from: 'team@freecodecamp.org',
subject: 'Abuse Report : Reporting ' + username + "'s profile.",
subject: `Abuse Report : Reporting ${username}'s profile.`,
text: dedent(`
Hello Team,\n
This is to report the profile of ${username}.\n