Skip to content

Commit

Permalink
Merge pull request #4404 from Giveth/243_fix_create_donation_errors
Browse files Browse the repository at this point in the history
Hotfix - Make sure chainId is not undefined when call create donation endpoint
  • Loading branch information
mohammadranjbarz authored Jul 11, 2024
2 parents c048138 + 343669e commit c2d37de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/hooks/useCreateEvmDonation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const useCreateEvmDonation = () => {
transaction = await retryFetchEVMTransaction(txHash);
if (transaction) {
donationData = {
chainId: transaction.chainId!,
chainId: chainId || token.networkId,
txHash: transaction.hash,
amount: amount,
token,
Expand Down Expand Up @@ -131,7 +131,7 @@ export const useCreateEvmDonation = () => {
return id;
} catch (e: any) {
await postRequest('/api/donation-backup', true, {
chainId: transaction?.chainId!,
chainId: chainId || token.networkId,
txHash: transaction?.hash,
amount: amount,
token,
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useCreateSolanaDonation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const useCreateSolanaDonation = () => {
return id;
} catch (e: any) {
await postRequest('/api/donation-backup', true, {
chainId: transaction?.chainId!,
chainId: transaction?.chainId || 0,
txHash: transaction?.hash,
amount: amount,
token,
Expand Down

0 comments on commit c2d37de

Please sign in to comment.