fix: show only user-typed notes on appointment card
Remove auto-appending of "Appointment with [staff name]" to notes on save, and preserve existing notes when dragging an appointment to a new slot. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -265,7 +265,7 @@ export function AppointmentForm({
|
||||
title = format(data.date, "MMMM d");
|
||||
}
|
||||
|
||||
let notes = data.notes || "";
|
||||
const notes = data.notes || "";
|
||||
|
||||
const selectedStaff =
|
||||
staffMembers.find((staff) => staff.id?.toString() === data.staffId) ||
|
||||
@@ -273,14 +273,7 @@ export function AppointmentForm({
|
||||
|
||||
if (!selectedStaff) {
|
||||
console.error("No staff selected and no available staff in the list");
|
||||
return; // Handle this case as well
|
||||
}
|
||||
|
||||
// If there's no staff information in the notes, add it
|
||||
if (!notes.includes("Appointment with")) {
|
||||
notes = notes
|
||||
? `${notes}\nAppointment with ${selectedStaff?.name}`
|
||||
: `Appointment with ${selectedStaff?.name}`;
|
||||
return;
|
||||
}
|
||||
|
||||
const formattedDate = formatLocalDate(data.date);
|
||||
|
||||
Reference in New Issue
Block a user