-
Notifications
You must be signed in to change notification settings - Fork 47
Bug fix: Brand On boarding doesn't work #114
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughA new Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant OnboardingComponent
participant DB
User->>OnboardingComponent: Submit brand onboarding form
OnboardingComponent->>DB: Query users table for user_id
alt User not found (PGRST116)
OnboardingComponent->>DB: Insert user record (id, username, email, role='brand')
else Other error
OnboardingComponent->>OnboardingComponent: Throw error
end
OnboardingComponent->>DB: Insert brand record linked to user_id
DB-->>OnboardingComponent: Confirmation
OnboardingComponent-->>User: Proceed to dashboard
Estimated code review effort2 (~15 minutes) Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🧠 Learnings (1)Frontend/src/components/Onboarding.tsx (1)Learnt from: Saahi30 🧬 Code Graph Analysis (1)Frontend/src/components/Onboarding.tsx (1)
🧰 Additional context used🧠 Learnings (1)Frontend/src/components/Onboarding.tsx (1)Learnt from: Saahi30 🧬 Code Graph Analysis (1)Frontend/src/components/Onboarding.tsx (1)
🔇 Additional comments (4)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Closes #110
📝 Description
This PR fixes the bug :When On boarding as a brand submitting brand results in different error's and not letting user move ahead
🔧 Changes Made
Added a logic to check if the user exists in users table before all the other logic in handleBrandSubmit() .If user is not there it creates a new row for the user before making any changes to the brands table.
Added the model for brands table for create tables at the startup of the backend.
📷 Screenshots or Visual Changes (if applicable)
nil
🤝 Collaboration
nil
✅ Checklist
Summary by CodeRabbit
New Features
Bug Fixes