plane
plane copied to clipboard
[WEB-5827] fix: persist external cover image URLs (Unsplash) in project updates
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 handleCoverImageChange function was returning null for external URLs, causing the update payload to exclude the cover image.
Root Cause
The handleCoverImageChange function only returned a payload for:
- Image removal (returns null values)
- Local static images that need upload (for user assets only)
External URLs like Unsplash images are classified as "uploaded_asset" type and don't require upload, so the function fell through to return null, preventing the URL from being included in the update payload.
Solution
- Updated
handleCoverImageChangeto return the cover image URL in the payload for external/uploaded assets - Replaced
cover_image_urlwithcover_imagefields
Testing
- [x] Verify Unsplash images are saved when selected in project form
- [x] Verify local static images still upload correctly
- [x] Verify image removal still works correctly
- [x] Verify no regressions in existing cover image functionality
Summary by CodeRabbit
-
Bug Fixes
- Improved cover image handling for uploaded and external assets to ensure consistent processing across all asset types.
✏️ Tip: You can customize this high-level summary in your review settings.