-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve conflicts #1703
Resolve conflicts #1703
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -162,14 +162,14 @@ export const donationsTotalAmountPerDateRange = async ( | |||||||||||||
.andWhere('project.verified = true'); | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
const donationsUsdAmount = await query | ||||||||||||||
.cache( | ||||||||||||||
`donationsTotalAmountPerDateRange-${fromDate || ''}-${toDate || ''}-${ | ||||||||||||||
networkId || 'all' | ||||||||||||||
}-${onlyVerified || 'all'}`, | ||||||||||||||
300000, | ||||||||||||||
) | ||||||||||||||
.getRawOne(); | ||||||||||||||
const donationsUsdAmount = await query.getRawOne(); | ||||||||||||||
|
||||||||||||||
query.cache( | ||||||||||||||
`donationsTotalAmountPerDateRange-${fromDate || ''}-${toDate || ''}-${ | ||||||||||||||
networkId || 'all' | ||||||||||||||
}-${onlyVerified || 'all'}`, | ||||||||||||||
300000, | ||||||||||||||
); | ||||||||||||||
Comment on lines
+167
to
+172
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove unnecessary caching logic. The caching logic is redundant and can be removed to simplify the function. - query.cache(
- `donationsTotalAmountPerDateRange-${fromDate || ''}-${toDate || ''}-${
- networkId || 'all'
- }-${onlyVerified || 'all'}`,
- 300000,
- ); Committable suggestion
Suggested change
|
||||||||||||||
|
||||||||||||||
return donationsUsdAmount.sum; | ||||||||||||||
Comment on lines
173
to
174
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the return value. Ensure the function returns the correct value after removing the caching logic. - return donationsUsdAmount.sum;
+ const donationsUsdAmount = await query.getRawOne();
+ return donationsUsdAmount.sum;
|
||||||||||||||
}; | ||||||||||||||
|
@@ -247,14 +247,14 @@ export const donationsNumberPerDateRange = async ( | |||||||||||||
.andWhere('project.verified = true'); | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
const donationsUsdAmount = await query | ||||||||||||||
.cache( | ||||||||||||||
`donationsTotalNumberPerDateRange-${fromDate || ''}-${toDate || ''}--${ | ||||||||||||||
networkId || 'all' | ||||||||||||||
}-${onlyVerified || 'all'}`, | ||||||||||||||
300000, | ||||||||||||||
) | ||||||||||||||
.getRawOne(); | ||||||||||||||
const donationsUsdAmount = await query.getRawOne(); | ||||||||||||||
|
||||||||||||||
Comment on lines
+250
to
+251
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove redundant variable assignment. The variable - const donationsUsdAmount = await query.getRawOne(); Committable suggestion
Suggested change
|
||||||||||||||
query.cache( | ||||||||||||||
`donationsTotalNumberPerDateRange-${fromDate || ''}-${toDate || ''}--${ | ||||||||||||||
networkId || 'all' | ||||||||||||||
}-${onlyVerified || 'all'}`, | ||||||||||||||
300000, | ||||||||||||||
); | ||||||||||||||
Comment on lines
+252
to
+257
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove unnecessary caching logic. The caching logic is redundant and can be removed to simplify the function. - query.cache(
- `donationsTotalNumberPerDateRange-${fromDate || ''}-${toDate || ''}--${
- networkId || 'all'
- }-${onlyVerified || 'all'}`,
- 300000,
- ); Committable suggestion
Suggested change
|
||||||||||||||
|
||||||||||||||
return donationsUsdAmount.count; | ||||||||||||||
Comment on lines
258
to
259
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the return value. Ensure the function returns the correct value after removing the caching logic. - return donationsUsdAmount.count;
+ const donationsCount = await query.getRawOne();
+ return donationsCount.count;
|
||||||||||||||
}; | ||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove redundant variable assignment.
The variable
donationsUsdAmount
is assigned but not used before the caching operation. This assignment can be removed to streamline the code.- const donationsUsdAmount = await query.getRawOne();
Committable suggestion