Browse Source

fix(vapi-webhook): add missing id field for call_logs insert

Fszontagh 4 months ago
parent
commit
b12fc63bd5
1 changed files with 3 additions and 0 deletions
  1. 3 0
      supabase/functions/vapi-webhook/index.ts

+ 3 - 0
supabase/functions/vapi-webhook/index.ts

@@ -130,6 +130,9 @@ serve(async (req) => {
 
 
     // Prepare call log data
     // Prepare call log data
     const callLogData = {
     const callLogData = {
+      // Primary key - generate UUID for the call log
+      id: crypto.randomUUID(),
+
       // VAPI-specific fields
       // VAPI-specific fields
       vapi_call_id: call?.id || crypto.randomUUID(),
       vapi_call_id: call?.id || crypto.randomUUID(),
       vapi_timestamp: timestamp,
       vapi_timestamp: timestamp,