feat: implement event submission flow with image upload and modal interface
This commit is contained in:
@@ -13,7 +13,13 @@ export async function uploadImage(formData: FormData) {
|
||||
|
||||
// Convert to Base64
|
||||
const base64 = buffer.toString('base64');
|
||||
const mimeType = file.type || 'image/jpeg';
|
||||
let mimeType = file.type || 'image/jpeg';
|
||||
|
||||
// Normalize JPEG mime types
|
||||
if (mimeType === 'image/jpg' || mimeType === 'image/pjpeg') {
|
||||
mimeType = 'image/jpeg';
|
||||
}
|
||||
|
||||
const dataUrl = `data:${mimeType};base64,${base64}`;
|
||||
|
||||
// Return the data URL directly (it will be saved in the database)
|
||||
|
||||
Reference in New Issue
Block a user