ever-co / ever-gauzy

Ever® Gauzy™ - Open Business Management Platform (ERP/CRM/HRM/ATS/PM) - https://gauzy.co
https://gauzy.co
GNU Affero General Public License v3.0
2.28k stars 538 forks source link

[Bug] Organization Profile logo uploading and Employee Profile picture uploading not working #7944

Closed evereq closed 1 month ago

evereq commented 3 months ago

Trying to upload profile and company picture. I'm getting an error: https://api.gauzy.co/api/image-assets/upload/profile_pictures' from origin 'https://app.gauzy.co/' has been blocked by CORS policy

image

rahul-rocket commented 3 months ago

Current Feature Description

We have implemented a feature where the profile pictures for employees and organization logos are stored in the image_asset table, and their respective IDs are saved in the corresponding tables (Employee, Organization). Previously, we were using Cloudinary for image storage, but now we have transitioned to using our file storage provider.

Currently, the User table contains two columns related to images:

Issue Description

When updating an employee or organization profile, the latest uploaded picture should be displayed. However, there is confusion on which field to prioritize (imageUrl or imageId) when both are set.

Suggested Improvements

Field Utilization:

Additionally, if we add a record to the table with images (where imageId is set), then other tables (if they have imageUrl) need to have such imageUrl equal to the just uploaded image URL. This means that during uploading, we not only update the image_asset table but also update imageUrl in the Employee or Organization tables. This ensures that if we have imageId, imageUrl is also set correctly and we can use either field as needed, keeping both in sync.

Consistency Across the System:

samuelmbabhazi commented 1 month ago

@evereq , @rahul-rocket https://www.loom.com/share/59446717b2c8446fba4fcc791f630a5b?sid=14973877-0cf8-41e7-a273-b98be7c20600