Skip to content

feat: abstract API logic into reusable custom React hooks#2816

Open
ArshVermaGit wants to merge 1 commit into
ritesh-1918:mainfrom
ArshVermaGit:feature/custom-api-hooks
Open

feat: abstract API logic into reusable custom React hooks#2816
ArshVermaGit wants to merge 1 commit into
ritesh-1918:mainfrom
ArshVermaGit:feature/custom-api-hooks

Conversation

@ArshVermaGit

Copy link
Copy Markdown

This PR addresses the technical debt of scattered useEffect API calls by establishing a dedicated hooks infrastructure for the frontend. To ensure zero merge conflicts with concurrent feature development across other branches, this PR introduces the completed abstraction layer as entirely new, isolated files in Frontend/src/hooks/ (useTickets.js, useAuth.js, useCompany.js). These hooks securely wrap all Supabase initialization, query logic, state management (loading, error, data), and mutations (createTicket, updateCompany) into clean interfaces. This structural foundation perfectly separates business logic from UI components, allowing subsequent feature branches to progressively adopt the hooks without triggering massive git conflicts in existing active files.

Closes #2815

@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

@ArshVermaGit is attempting to deploy a commit to the ritesh Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@ArshVermaGit, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 16 minutes and 46 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 753ddd81-ec28-4ac7-97ff-f57704036fdd

📥 Commits

Reviewing files that changed from the base of the PR and between da8faf2 and c7aa200.

📒 Files selected for processing (4)
  • Frontend/src/hooks/index.js
  • Frontend/src/hooks/useAuth.js
  • Frontend/src/hooks/useCompany.js
  • Frontend/src/hooks/useTickets.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ArshVermaGit ArshVermaGit left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: Scattered API Logic and Missing Custom Hooks

1 participant