Your commit message

This commit is contained in:
Mo Tarbin
2025-05-27 11:58:52 -04:00
parent 6ddb8d01ec
commit 709a91b1db
11 changed files with 452 additions and 91 deletions
+3 -3
View File
@@ -31,12 +31,12 @@ const RichTextEditor = ({
if (!file) return
try {
// Define compression options based on entity type
// Define compression options based on entity type ( this need a revist later)
const compressionOptions = {
maxSizeMB: entityType === 'profile' ? 0.5 : 1, // Smaller size for profile images
maxWidthOrHeight: entityType === 'profile' ? 320 : 1200, // Smaller dimensions for profile images
useWebWorker: true,
fileType: 'image/jpeg', // Always convert to JPEG
fileType: 'image/jpeg',
}
// Compress the image
@@ -59,6 +59,7 @@ const RichTextEditor = ({
formData.append('file', compressedJpegFile)
formData.append('entityId', entityId)
formData.append('entityType', entityType)
const response = await UploadFile('/assets/chore', {
method: 'POST',
body: formData,
@@ -83,7 +84,6 @@ const RichTextEditor = ({
})
return
}
const data = await response.json()
const url = resolvePhotoURL(data.url || data.sign)
// Insert image into Quill