This commit is contained in:
Matt 2025-06-09 23:48:00 +02:00
parent cc2cc282b9
commit 2da6c06aab
1 changed files with 10 additions and 4 deletions

View File

@ -67,6 +67,7 @@ export const updateInterest = async (id: string, data: Partial<Interest>, retryC
const cleanData: Record<string, any> = {};
// Only include fields that are part of the InterestsRequest schema
// Removed webhook fields: "Request More Information", "Request More Info - To Sales", "EOI Send to Sales"
const allowedFields = [
"Full Name",
"Yacht Name",
@ -82,7 +83,6 @@ export const updateInterest = async (id: string, data: Partial<Interest>, retryC
"Width",
"Depth",
"Created At",
"Request More Information",
"Source",
"Place of Residence",
"Contact Method Preferred",
@ -90,8 +90,6 @@ export const updateInterest = async (id: string, data: Partial<Interest>, retryC
"Berth Number",
"EOI Time Sent",
"Lead Category",
"Request More Info - To Sales",
"EOI Send to Sales",
"Time LOI Sent",
"EOI Status",
"Berth Info Sent Status",
@ -108,7 +106,15 @@ export const updateInterest = async (id: string, data: Partial<Interest>, retryC
// Filter the data to only include allowed fields
for (const field of allowedFields) {
if (field in data) {
cleanData[field] = (data as any)[field];
const value = (data as any)[field];
// Skip webhook-type fields and other object fields that shouldn't be sent
if (value && typeof value === 'object' && !Array.isArray(value)) {
console.log(`[nocodb.updateInterest] Skipping object field: ${field}`, value);
continue;
}
cleanData[field] = value;
}
}