Skip to content

Commit

Permalink
Fix return csv for gnosis donations
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadranjbarz committed Jul 9, 2024
1 parent 19fce93 commit ad712b1
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,13 @@ app.get(`/calculate`,
raisedValueSumExcludedPurpleList: Math.ceil(raisedValueSum),
givDistributed,
givethioDonationsAmount: Math.ceil(totalDonationsAmount),
optimism: {
gnosis: {
smartContractParams: await createSmartContractCallAddBatchParams(
{
nrGIVAddress,
donationsWithShare: optimismDonationsWithShare.filter(givback => givback.givback > 0),
givRelayerAddress: optimismRelayerAddress,
network:'optimism'
network:'gnosis'
},
Number(maxAddressesPerFunctionCall) || 200
),
Expand All @@ -237,7 +237,7 @@ app.get(`/calculate`,
nrGIVAddress,
donationsWithShare: allOtherChainsDonationsWithShare.filter(givback => givback.givback > 0),
givRelayerAddress: gnosisRelayerAddress,
network:'gnosis'
network:'optimism'
},
Number(maxAddressesPerFunctionCall) || 200
),
Expand All @@ -262,8 +262,8 @@ app.get(`/calculate`,
res.setHeader('Content-disposition', "attachment; filename=" + fileName);
res.setHeader('Content-type', 'application/json');
res.send(csv)
} else if (download === "optimism") {
const csv = parse(response.optimism.givbacks.map((item: DonationResponse) => {
} else if (download === "gnosis") {
const csv = parse(response.gnosis.givbacks.map((item: DonationResponse) => {
return {
givDistributed,
givPrice,
Expand Down Expand Up @@ -743,13 +743,13 @@ app.get(`/calculate-updated`,
raisedValueSumExcludedPurpleList: Math.ceil(raisedValueSum),
givDistributed,
givethioDonationsAmount: Math.ceil(totalDonationsAmount),
optimism: {
gnosis: {
smartContractParams: await createSmartContractCallAddBatchParams(
{
nrGIVAddress,
donationsWithShare: optimismDonationsWithShare.filter(givback => givback.givback > 0),
givRelayerAddress: optimismRelayerAddress,
network:'optimism'
network:'gnosis'
},
Number(maxAddressesPerFunctionCall) || 200
),
Expand All @@ -761,7 +761,7 @@ app.get(`/calculate-updated`,
nrGIVAddress,
donationsWithShare: allOtherChainsDonationsWithShare.filter(givback => givback.givback > 0),
givRelayerAddress: gnosisRelayerAddress,
network:'gnosis'
network:'optimism'
},
Number(maxAddressesPerFunctionCall) || 200
),
Expand All @@ -786,8 +786,8 @@ app.get(`/calculate-updated`,
res.setHeader('Content-disposition', "attachment; filename=" + fileName);
res.setHeader('Content-type', 'application/json');
res.send(csv)
} else if (download === "optimism") {
const csv = parse(response.optimism.givbacks.map((item: DonationResponse) => {
} else if (download === "gnosis") {
const csv = parse(response.gnosis.givbacks.map((item: DonationResponse) => {
return {
givDistributed,
givPrice,
Expand Down

0 comments on commit ad712b1

Please sign in to comment.