mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 13:51:13 -05:00
Fix: Enable TypeScript strict mode
This commit is contained in:
@@ -4,6 +4,7 @@ import { ImageAssignments } from '@/components/upload/EntityMultiImageUploader';
|
||||
import { uploadPendingImages } from './imageUploadHelper';
|
||||
import type { ProcessedImage } from './supabaseHelpers';
|
||||
import { extractChangedFields } from './submissionChangeDetection';
|
||||
import type { CompanyDatabaseRecord, TimelineEventDatabaseRecord } from '@/types/company-data';
|
||||
|
||||
/**
|
||||
* ═══════════════════════════════════════════════════════════════════
|
||||
@@ -723,7 +724,7 @@ export async function submitManufacturerUpdate(
|
||||
item_type: 'manufacturer',
|
||||
action_type: 'edit',
|
||||
item_data: {
|
||||
...extractChangedFields(data, existingCompany as any),
|
||||
...extractChangedFields(data, existingCompany as Partial<CompanyDatabaseRecord>),
|
||||
company_id: companyId, // Always include for relational integrity
|
||||
company_type: 'manufacturer', // Always include for entity type discrimination
|
||||
images: processedImages as unknown as Json
|
||||
@@ -831,7 +832,7 @@ export async function submitDesignerUpdate(
|
||||
item_type: 'designer',
|
||||
action_type: 'edit',
|
||||
item_data: {
|
||||
...extractChangedFields(data, existingCompany as any),
|
||||
...extractChangedFields(data, existingCompany as Partial<CompanyDatabaseRecord>),
|
||||
company_id: companyId, // Always include for relational integrity
|
||||
company_type: 'designer', // Always include for entity type discrimination
|
||||
images: processedImages as unknown as Json
|
||||
@@ -939,7 +940,7 @@ export async function submitOperatorUpdate(
|
||||
item_type: 'operator',
|
||||
action_type: 'edit',
|
||||
item_data: {
|
||||
...extractChangedFields(data, existingCompany as any),
|
||||
...extractChangedFields(data, existingCompany as Partial<CompanyDatabaseRecord>),
|
||||
company_id: companyId, // Always include for relational integrity
|
||||
company_type: 'operator', // Always include for entity type discrimination
|
||||
images: processedImages as unknown as Json
|
||||
@@ -1047,7 +1048,7 @@ export async function submitPropertyOwnerUpdate(
|
||||
item_type: 'property_owner',
|
||||
action_type: 'edit',
|
||||
item_data: {
|
||||
...extractChangedFields(data, existingCompany as any),
|
||||
...extractChangedFields(data, existingCompany as Partial<CompanyDatabaseRecord>),
|
||||
company_id: companyId, // Always include for relational integrity
|
||||
company_type: 'property_owner', // Always include for entity type discrimination
|
||||
images: processedImages as unknown as Json
|
||||
@@ -1128,7 +1129,7 @@ export async function submitTimelineEvent(
|
||||
p_user_id: userId,
|
||||
p_submission_type: 'milestone',
|
||||
p_content: content,
|
||||
p_items: items as any,
|
||||
p_items: items as unknown as Json[],
|
||||
});
|
||||
|
||||
if (error || !submissionId) {
|
||||
@@ -1169,9 +1170,9 @@ export async function submitTimelineEventUpdate(
|
||||
}
|
||||
|
||||
// Extract only changed fields from form data
|
||||
const changedFields = extractChangedFields(data, originalEvent as any);
|
||||
const changedFields = extractChangedFields(data, originalEvent as Partial<Record<string, unknown>>);
|
||||
|
||||
const itemData: Record<string, any> = {
|
||||
const itemData: Record<string, unknown> = {
|
||||
...changedFields,
|
||||
// Always include entity reference (for FK integrity)
|
||||
entity_type: originalEvent.entity_type,
|
||||
|
||||
Reference in New Issue
Block a user