mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-25 19:11:13 -05:00
Fix remaining production readiness issues
This commit is contained in:
@@ -2,6 +2,8 @@ import { supabase } from '@/integrations/supabase/client';
|
||||
import type { Json } from '@/integrations/supabase/types';
|
||||
import { uploadPendingImages } from './imageUploadHelper';
|
||||
import { CompanyFormData, TempCompanyData } from '@/types/company';
|
||||
import { logger } from './logger';
|
||||
import { getErrorMessage } from './errorHandler';
|
||||
|
||||
export type { CompanyFormData, TempCompanyData };
|
||||
|
||||
@@ -19,8 +21,12 @@ export async function submitCompanyCreation(
|
||||
...data.images,
|
||||
uploaded: uploadedImages
|
||||
};
|
||||
} catch (error) {
|
||||
console.error(`Failed to upload images for ${companyType} creation:`, error);
|
||||
} catch (error: unknown) {
|
||||
const errorMsg = getErrorMessage(error);
|
||||
logger.error('Failed to upload images for company', {
|
||||
action: `${companyType}_creation`,
|
||||
error: errorMsg
|
||||
});
|
||||
throw new Error('Failed to upload images. Please check your connection and try again.');
|
||||
}
|
||||
}
|
||||
@@ -91,8 +97,13 @@ export async function submitCompanyUpdate(
|
||||
...data.images,
|
||||
uploaded: uploadedImages
|
||||
};
|
||||
} catch (error) {
|
||||
console.error(`Failed to upload images for ${existingCompany.company_type} update:`, error);
|
||||
} catch (error: unknown) {
|
||||
const errorMsg = getErrorMessage(error);
|
||||
logger.error('Failed to upload images for company update', {
|
||||
action: `${existingCompany.company_type}_update`,
|
||||
companyId,
|
||||
error: errorMsg
|
||||
});
|
||||
throw new Error('Failed to upload images. Please check your connection and try again.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user