Skip to content

Commit

Permalink
chore(funding-required): debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Keeqler committed Oct 10, 2024
1 parent 437dccd commit 111c678
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pages/api/funding-required.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ async function handle(
: !project.isFunded
)

console.log('Funding required filtered projects:')
console.log(projects)

const rates: Record<string, number | undefined> = {}

// Get exchange rates if target asset is not USD (or if there is no target asset)
Expand Down Expand Up @@ -204,12 +207,13 @@ async function handle(
remaining_amount_usd: Number((remainingAmountUsd > 0 ? remainingAmountUsd : 0).toFixed(2)),
address_btc: bitcoinAddress,
address_xmr: moneroAddress,
raised_amount_percent:
raised_amount_percent: Math.floor(
((project.totalDonationsBTCInFiat +
project.totalDonationsXMRInFiat +
project.totalDonationsFiat) /
project.goal) *
100,
100
),
contributions: project.numDonationsBTC + project.numDonationsXMR + project.numDonationsFiat,
}
})
Expand Down
6 changes: 6 additions & 0 deletions utils/md.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ export async function getProjects(fundSlug?: FundSlug) {
})
: []

console.log('Donations for', project.title)
console.log(donations)

donations.forEach((donation) => {
if (donation.cryptoCode === 'XMR') {
project.numDonationsXMR += 1
Expand Down Expand Up @@ -132,5 +135,8 @@ export async function getProjects(fundSlug?: FundSlug) {
})
)

console.log('getProjects return:')
console.log(projects)

return projects
}

0 comments on commit 111c678

Please sign in to comment.