fix: convert extracted image blob to base64 before sending to API

The extracted image blob from AI extraction was not being sent to the backend
because Blob objects cannot be JSON serialized. Fixed by:

1. Converting Blob to base64 before sending to API
2. Renaming fields: extractedImageBlob → extracted_image_bytes, imageProcessing → image_processing
3. Removing Blob from local DB (keep original data structure for IndexedDB)
4. Applying same fix to both single item and batch update flows

This ensures the auto-photo-save feature receives the image data it needs.
This commit is contained in:
2026-04-21 19:53:53 +03:00
parent f72b976c33
commit cbfd7232ca
3 changed files with 49 additions and 6 deletions

View File

@@ -94,7 +94,8 @@
"Bash(grep -E \"\\\\.\\(py|txt\\)$\")",
"Bash(npx vitest *)",
"Bash(sed -i 's/jest\\\\.fn\\(\\)/vi.fn\\(\\)/g' tests/hooks/useAIExtraction.test.ts)",
"Bash(sed -i 's/as jest\\\\.Mock/as any/g' tests/hooks/useAIExtraction.test.ts)"
"Bash(sed -i 's/as jest\\\\.Mock/as any/g' tests/hooks/useAIExtraction.test.ts)",
"Bash(grep -E \"\\\\.tsx?$\")"
]
}
}