not finding delegates pledges

This commit is contained in:
Barry Gitarts 2019-05-07 16:27:08 -04:00 committed by Barry G
parent addd5116e5
commit 0331f53c18
2 changed files with 3 additions and 4 deletions

View File

@ -38,7 +38,7 @@ const batchAddDelegates = async (pledges, profiles, existing) => {
pledges.forEach(pledge => {
const { delegates } = pledge
delegates.forEach((delegateInfo, idx) => {
const profile = profiles.find(p => p.idProfile === delegateInfo.idDelegate)
const profile = profiles.find(p => p.idProfile === Number(delegateInfo.idDelegate))
const exists = delegateRecordExists(profile, pledge, idx+1, existing)
if (!exists) {
batch.push(

View File

@ -101,7 +101,6 @@ const SubmissionSection = ({ classes, profiles, delegatePledges, projectId, open
const filteredPledges = values.delegateProfile ? delegatePledges.filter(
d => d.profile.id === values.delegateProfile.id && d.pledgeData.amount !== '0' && d.pledgeData.pledgeState === 0 && d.pledgeData.intendedProject === 0
) : null
console.log({filteredPledges})
return (
<form onSubmit={handleSubmit} className={classes.submissionRoot}>
{profiles && profiles.length === 0 &&