fix(donate): remove isDontating check from year-end

This commit is contained in:
Mrugesh Mohapatra
2019-12-18 10:46:13 +05:30
committed by Ahmad Abdolsaheb
parent 663f726c4e
commit 8db0f89634
7 changed files with 95 additions and 132 deletions

View File

@ -273,16 +273,6 @@ export default function donateBoot(app, done) {
};
return Promise.resolve(fccUser)
.then(nonDonatingUser => {
const { isDonating } = nonDonatingUser;
if (isDonating) {
throw {
message: `User already has active donation(s).`,
type: 'AlreadyDonatingError'
};
}
return nonDonatingUser;
})
.then(createCustomer)
.then(customer => {
return createOneTimeCharge(customer).then(charge => {
@ -292,10 +282,7 @@ export default function donateBoot(app, done) {
})
.then(createAsyncUserDonation)
.catch(err => {
if (
err.type === 'StripeCardError' ||
err.type === 'AlreadyDonatingError'
) {
if (err.type === 'StripeCardError') {
return res.status(402).send({ error: err.message });
}
return res