[WEB-5827] fix: persist external cover image URLs (Unsplash) in project updates#8482
Conversation
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (4)**/*.{ts,tsx,mts,cts}📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{js,jsx,ts,tsx,json,css}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
🔇 Additional comments (2)
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. Comment |
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where external cover image URLs (like Unsplash images) were not being persisted to the backend when selected for projects. The root cause was that the handleCoverImageChange helper function was returning null for external URLs instead of returning the URL in the update payload.
Key Changes
- Modified
handleCoverImageChangeto return external/uploaded asset URLs in the payload instead ofnull - Changed the field name from
cover_image_urltocover_imagefor uploaded assets, aligning with the backend API contract wherecover_imageis used for uploads andcover_image_urlis a readonly field for rendering
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Problem
When selecting an Unsplash image (or any external URL) as a project cover image, the URL wasn't being saved to the backend. The
handleCoverImageChangefunction was returningnullfor external URLs, causing the update payload to exclude the cover image.Root Cause
The
handleCoverImageChangefunction only returned a payload for:External URLs like Unsplash images are classified as
"uploaded_asset"type and don't require upload, so the function fell through toreturn null, preventing the URL from being included in the update payload.Solution
handleCoverImageChangeto return the cover image URL in the payload for external/uploaded assetscover_image_urlwithcover_imagefieldsTesting
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.