Merge remote-tracking branch 'origin/main' into feature/gro-118-better-auth
This commit is contained in:
@@ -131,9 +131,18 @@ export function AppointmentsPage() {
|
|||||||
setError(null);
|
setError(null);
|
||||||
Promise.all([
|
Promise.all([
|
||||||
loadAppointments(),
|
loadAppointments(),
|
||||||
fetch("/api/clients").then((r) => r.json() as Promise<Client[]>).then(setClients),
|
fetch("/api/clients").then((r) => {
|
||||||
fetch("/api/services").then((r) => r.json() as Promise<Service[]>).then(setServices),
|
if (!r.ok) throw new Error(`HTTP ${r.status}`);
|
||||||
fetch("/api/staff").then((r) => r.json() as Promise<Staff[]>).then(setStaff),
|
return r.json() as Promise<Client[]>;
|
||||||
|
}).then(setClients),
|
||||||
|
fetch("/api/services").then((r) => {
|
||||||
|
if (!r.ok) throw new Error(`HTTP ${r.status}`);
|
||||||
|
return r.json() as Promise<Service[]>;
|
||||||
|
}).then(setServices),
|
||||||
|
fetch("/api/staff").then((r) => {
|
||||||
|
if (!r.ok) throw new Error(`HTTP ${r.status}`);
|
||||||
|
return r.json() as Promise<Staff[]>;
|
||||||
|
}).then(setStaff),
|
||||||
])
|
])
|
||||||
.catch((e: unknown) => setError(e instanceof Error ? e.message : "Unknown error"))
|
.catch((e: unknown) => setError(e instanceof Error ? e.message : "Unknown error"))
|
||||||
.finally(() => setLoading(false));
|
.finally(() => setLoading(false));
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { useNavigate } from "react-router-dom";
|
|||||||
|
|
||||||
interface StaffUser {
|
interface StaffUser {
|
||||||
id: string;
|
id: string;
|
||||||
|
userId: string | null;
|
||||||
name: string;
|
name: string;
|
||||||
email: string;
|
email: string;
|
||||||
role: string;
|
role: string;
|
||||||
@@ -66,7 +67,7 @@ export function DevLoginSelector() {
|
|||||||
{staff.map((s) => (
|
{staff.map((s) => (
|
||||||
<button
|
<button
|
||||||
key={s.id}
|
key={s.id}
|
||||||
onClick={() => selectUser("staff", s.id, s.name)}
|
onClick={() => selectUser("staff", s.userId ?? s.id, s.name)}
|
||||||
style={userButtonStyle}
|
style={userButtonStyle}
|
||||||
>
|
>
|
||||||
<div style={{ fontWeight: 600, fontSize: 14 }}>{s.name}</div>
|
<div style={{ fontWeight: 600, fontSize: 14 }}>{s.name}</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user