updates
This commit is contained in:
parent
cc2cc282b9
commit
2da6c06aab
|
|
@ -67,6 +67,7 @@ export const updateInterest = async (id: string, data: Partial<Interest>, retryC
|
||||||
const cleanData: Record<string, any> = {};
|
const cleanData: Record<string, any> = {};
|
||||||
|
|
||||||
// Only include fields that are part of the InterestsRequest schema
|
// 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 = [
|
const allowedFields = [
|
||||||
"Full Name",
|
"Full Name",
|
||||||
"Yacht Name",
|
"Yacht Name",
|
||||||
|
|
@ -82,7 +83,6 @@ export const updateInterest = async (id: string, data: Partial<Interest>, retryC
|
||||||
"Width",
|
"Width",
|
||||||
"Depth",
|
"Depth",
|
||||||
"Created At",
|
"Created At",
|
||||||
"Request More Information",
|
|
||||||
"Source",
|
"Source",
|
||||||
"Place of Residence",
|
"Place of Residence",
|
||||||
"Contact Method Preferred",
|
"Contact Method Preferred",
|
||||||
|
|
@ -90,8 +90,6 @@ export const updateInterest = async (id: string, data: Partial<Interest>, retryC
|
||||||
"Berth Number",
|
"Berth Number",
|
||||||
"EOI Time Sent",
|
"EOI Time Sent",
|
||||||
"Lead Category",
|
"Lead Category",
|
||||||
"Request More Info - To Sales",
|
|
||||||
"EOI Send to Sales",
|
|
||||||
"Time LOI Sent",
|
"Time LOI Sent",
|
||||||
"EOI Status",
|
"EOI Status",
|
||||||
"Berth Info Sent 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
|
// Filter the data to only include allowed fields
|
||||||
for (const field of allowedFields) {
|
for (const field of allowedFields) {
|
||||||
if (field in data) {
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue