-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Fix the partner profile upload #2747
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
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughIntroduces partnerImageSchema to validate partner images from multiple sources (base64, R2 stored URL, public hosted URL, or Google Favicon URL). Updates onboardPartnerSchema.image to use partnerImageSchema, imports required constants and schemas, and enforces non-empty images with transformation of falsy inputs to an empty string. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant OnboardForm
participant Zod as Zod: partnerImageSchema
Client->>OnboardForm: Submit partner data (image)
OnboardForm->>Zod: Validate image
alt base64 image
Zod-->>OnboardForm: Accept via base64ImageSchema
else stored R2 URL
Zod-->>OnboardForm: Accept via storedR2ImageUrlSchema
else public hosted URL
Zod-->>OnboardForm: Accept via publicHostedImageSchema
else Google Favicon URL
Zod-->>OnboardForm: Accept if startsWith(GOOGLE_FAVICON_URL)
else falsy
Zod-->>OnboardForm: Transform to "" and fail "Image is required"
end
OnboardForm-->>Client: Validation result
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✨ Finishing Touches
🧪 Generate 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Summary by CodeRabbit