gpt-engineer-app[bot] commited on
Commit
c12b863
·
1 Parent(s): b504a84
Files changed (1) hide show
  1. src/components/upload-dialog.tsx +2 -1
src/components/upload-dialog.tsx CHANGED
@@ -60,9 +60,10 @@ export function UploadDialog({ onCreated }: { onCreated?: (id: string) => void }
60
  }
61
  }
62
 
 
63
  const { data: inc, error: insErr } = await supabase
64
  .from("incidents")
65
- .insert({ user_id: u.user.id, title, raw_text, file_url, file_name, source_type, status: "pending" })
66
  .select()
67
  .single();
68
  if (insErr) throw insErr;
 
60
  }
61
  }
62
 
63
+ const finalTitle = title.trim() || (raw_text ? raw_text.slice(0, 80) : file_name) || "Untitled incident";
64
  const { data: inc, error: insErr } = await supabase
65
  .from("incidents")
66
+ .insert({ user_id: u.user.id, title: finalTitle, raw_text, file_url, file_name, source_type, status: "pending" })
67
  .select()
68
  .single();
69
  if (insErr) throw insErr;