From 2da6c06aab1c9f3358e15164e9d329b94631dc8e Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 9 Jun 2025 23:48:00 +0200 Subject: [PATCH] updates --- server/utils/nocodb.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/server/utils/nocodb.ts b/server/utils/nocodb.ts index da94ea6..fdbe115 100644 --- a/server/utils/nocodb.ts +++ b/server/utils/nocodb.ts @@ -67,6 +67,7 @@ export const updateInterest = async (id: string, data: Partial, retryC const cleanData: Record = {}; // 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, 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, 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, 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; } }