This commit is contained in:
Matt 2025-06-10 21:09:07 +02:00
parent 09c32ae6cb
commit 2c575b321f
1 changed files with 6 additions and 0 deletions

View File

@ -196,6 +196,7 @@ export const createInterest = async (data: Partial<Interest>) => {
"Date Added", "Date Added",
"Width", "Width",
"Depth", "Depth",
"Created At",
"Source", "Source",
"Contact Method Preferred", "Contact Method Preferred",
"Lead Category", "Lead Category",
@ -213,6 +214,11 @@ export const createInterest = async (data: Partial<Interest>) => {
} }
} }
// Set Created At to current timestamp if not provided
if (!cleanData["Created At"]) {
cleanData["Created At"] = new Date().toISOString();
}
// Remove any computed or relation fields that shouldn't be sent // Remove any computed or relation fields that shouldn't be sent
delete cleanData.Id; delete cleanData.Id;
delete cleanData.Berths; delete cleanData.Berths;