@@ -160,7 +163,7 @@ function AppointmentCard({
{appt.notes}
)}
{isUpcoming(appt) && !readOnly && (
-
+
)}
{appt.status !== "completed" && appt.status !== "cancelled" && !readOnly && (
@@ -185,7 +188,7 @@ function AppointmentCard({
);
}
-export function CustomerNotesSection({ appointment: appt }: { appointment: Appointment }) {
+export function CustomerNotesSection({ appointment: appt, sessionId }: { appointment: Appointment; sessionId?: string | null }) {
const [notes, setNotes] = useState(appt.customerNotes || "");
const [saving, setSaving] = useState(false);
const [saved, setSaved] = useState(false);
@@ -193,16 +196,11 @@ export function CustomerNotesSection({ appointment: appt }: { appointment: Appoi
const isDisabled = appt.status === "completed" || appt.status === "cancelled";
- function getSessionId(): string | null {
- return sessionStorage.getItem("impersonationSessionId");
- }
-
async function handleSave() {
setSaving(true);
setError(null);
setSaved(false);
try {
- const sessionId = getSessionId();
const headers: Record = { "Content-Type": "application/json" };
if (sessionId) {
headers["X-Impersonation-Session-Id"] = sessionId;