Skip to content
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

Remove redundant Quota API calls #759

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

lethemanh
Copy link
Collaborator

@lethemanh lethemanh commented Dec 3, 2024

Remove redundant Quota API calls

Description

Whenever the useUserQuota hook is used, it automatically calls the Quota API. To fix this, we can remove the API call from the hook. Instead, the getQuota function from the hook can be used directly in the components or other hooks that rely on useUserQuota.

Related Issue

758

Motivation and Context

Reduce multiple unnecessary API calls to fetch quota are being triggered in the frontend

How Has This Been Tested?

The changes were tested using the browser's network tab in the developer tools. After reloading the page multiple times, it was confirmed that only one request is made to the Quota API per page load, ensuring the issue is resolved.

Screenshots (if appropriate):

CleanShot 2024-12-03 at 14 53 38@2x

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added the Signed-off-by statement at the end of my commit message.

@lethemanh lethemanh requested a review from shepilov December 3, 2024 08:00
@lethemanh lethemanh self-assigned this Dec 3, 2024
@lethemanh lethemanh added the bug Something isn't working label Dec 3, 2024
@ericlinagora ericlinagora added this to the v1.0.6 milestone Dec 3, 2024
@lethemanh lethemanh linked an issue Dec 4, 2024 that may be closed by this pull request
@lethemanh lethemanh merged commit 4c05cf9 into main Dec 4, 2024
7 checks passed
@lethemanh lethemanh deleted the fix/remove_redundant_quota_api_call branch December 4, 2024 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Remove redundant "Quota" API calls
4 participants