Skip to content

Commit a614a16

Browse files
Zeff01claude
andcommitted
feat: make client name optional in client outreach tracker
- Remove required validation from client name field - Update TypeScript interfaces to allow null client_name - Add "Unnamed Client" fallback display for records without names - Fix TypeScript null handling for conversation image 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 1ca000d commit a614a16

2 files changed

Lines changed: 5 additions & 11 deletions

File tree

‎apps/codebility/app/home/admin-controls/client-tracker/_components/ClientTrackerContent.tsx‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@ export default function ClientTrackerContent() {
7777
const handleSubmit = async (e: React.FormEvent) => {
7878
e.preventDefault();
7979

80-
if (!formData.client_name.trim()) {
81-
toast.error("Client name is required");
82-
return;
83-
}
84-
8580
setSubmitting(true);
8681
const result = await addClientOutreach(formData);
8782

@@ -229,13 +224,12 @@ export default function ClientTrackerContent() {
229224
</DialogHeader>
230225
<form onSubmit={handleSubmit} className="space-y-4">
231226
<div>
232-
<Label htmlFor="client_name">Client Name *</Label>
227+
<Label htmlFor="client_name">Client Name</Label>
233228
<Input
234229
id="client_name"
235230
value={formData.client_name}
236231
onChange={(e) => setFormData(prev => ({ ...prev, client_name: e.target.value }))}
237232
placeholder="John Doe"
238-
required
239233
/>
240234
</div>
241235

@@ -466,7 +460,7 @@ export default function ClientTrackerContent() {
466460
<div className="flex-1 min-w-0">
467461
<div className="flex items-baseline gap-2 flex-wrap">
468462
<h4 className="font-semibold text-sm text-gray-900 dark:text-gray-100">
469-
{record.client_name}
463+
{record.client_name || "Unnamed Client"}
470464
</h4>
471465
{record.client_company && (
472466
<span className="text-xs text-gray-500 dark:text-gray-400">
@@ -525,7 +519,7 @@ export default function ClientTrackerContent() {
525519
src={record.conversation_image}
526520
alt="Conversation screenshot"
527521
className="max-w-full h-auto rounded border border-gray-200 dark:border-gray-700 cursor-pointer hover:opacity-90 transition-opacity"
528-
onClick={() => window.open(record.conversation_image, '_blank')}
522+
onClick={() => record.conversation_image && window.open(record.conversation_image, '_blank')}
529523
/>
530524
</div>
531525
)}

‎apps/codebility/app/home/admin-controls/client-tracker/actions.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { getCurrentWeekStart } from "./utils";
77
export interface ClientOutreach {
88
id: string;
99
admin_id: string;
10-
client_name: string;
10+
client_name: string | null;
1111
client_email: string | null;
1212
client_company: string | null;
1313
job_link: string | null;
@@ -119,7 +119,7 @@ export async function getAdminOutreachStats(): Promise<{
119119
* Add a new client outreach record
120120
*/
121121
export async function addClientOutreach(formData: {
122-
client_name: string;
122+
client_name?: string;
123123
client_email?: string;
124124
client_company?: string;
125125
job_link?: string;

0 commit comments

Comments
 (0)